Skip to content

Commit

Permalink
Merge pull request #627 from MahendraR1/master
Browse files Browse the repository at this point in the history
Update direct-promethues-export-support.md
  • Loading branch information
subashd authored Jan 2, 2024
2 parents 32a7bb1 + a934210 commit d45090a
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions docs/configure/direct-promethues-export-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,35 @@ To enable NetScaler ingress controller to configure NetScaler CPX to support dir
- If your Prometheus server is outside the Kubernetes cluster, add a scrape job under `scrape_configs` in the [Prometheus configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/). For a sample Prometheus scrape job, see the [Prometheus integration documentation](https://docs.netscaler.com/en-us/citrix-adc/current-release/observability/prometheus-integration#prometheus-configuration).

- If your Prometheus server is within the same Kubernetes cluster, add a new Prometheus job to configure Prometheus for directly exporting from a NetScaler CPX pod. For more information, see [kubernetes_sd_config](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config). A sample Prometheus job is given as follows:

```yml

- job_name: 'kubernetes-cpx'
scheme: http
metrics_path: /nitro/v1/config/systemfile
params:
args: ['filename:metrics_prom_ns_analytics_time_series_profile.log,filelocation:/var/nslog']
format: ['prometheus']
basic_auth:
username: cpx # Prometheus username set in nsic.prometheusCredentialSecret
password: cpx # Prometheus password set in nsic.prometheusCredentialSecret
scrape_interval: 30s
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_netscaler_prometheus_scrape]
action: keep
regex: true
- source_labels: [__address__, __meta_kubernetes_pod_annotation_netscaler_prometheus_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name

```
```yml
- job_name: 'kubernetes-cpx'
scheme: http
metrics_path: /nitro/v1/config/systemfile
params:
args: ['filename:metrics_prom_ns_analytics_time_series_profile.log,filelocation:/var/nslog']
format: ['prometheus']
basic_auth:
username: # Prometheus username set in nsic.prometheusCredentialSecret
password: # Prometheus password set in nsic.prometheusCredentialSecret
scrape_interval: 30s
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_netscaler_prometheus_scrape]
action: keep
regex: true
- source_labels: [__address__, __meta_kubernetes_pod_annotation_netscaler_prometheus_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
```
**Note:**
For more information on Prometheus integration, see the [NetScaler Prometheus integration documentation](https://docs.netscaler.com/en-us/citrix-adc/current-release/observability/prometheus-integration).
Expand Down

0 comments on commit d45090a

Please sign in to comment.