Skip to content

Commit 2dae7dd

Browse files
authored
Update direct-promethues-export-support.md
tweaked YAML based on NSCN-2092
1 parent aa77295 commit 2dae7dd

1 file changed

Lines changed: 31 additions & 29 deletions

File tree

docs/configure/direct-promethues-export-support.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,37 @@ To enable NetScaler ingress controller to configure NetScaler CPX to support dir
2929

3030
- 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:
3131

32-
```
33-
- job_name: 'kubernetes-cpx'
34-
scheme: http
35-
metrics_path: /nitro/v1/config/systemfile
36-
params:
37-
args: ['filename:metrics_prom_ns_analytics_time_series_profile.log,filelocation:/var/nslog']
38-
format: ['prometheus']
39-
basic_auth:
40-
username: # Prometheus username set in nsic.prometheusCredentialSecret
41-
password: # Prometheus password set in nsic.prometheusCredentialSecret
42-
scrape_interval: 30s
43-
kubernetes_sd_configs:
44-
- role: pod
45-
relabel_configs:
46-
- source_labels: [__meta_kubernetes_pod_annotation_netscaler_prometheus_scrape]
47-
action: keep
48-
regex: true
49-
- source_labels: [__address__, __meta_kubernetes_pod_annotation_netscaler_prometheus_port]
50-
action: replace
51-
regex: ([^:]+)(?::\d+)?;(\d+)
52-
replacement: $1:$2
53-
target_label: __address__
54-
- source_labels: [__meta_kubernetes_namespace]
55-
action: replace
56-
target_label: kubernetes_namespace
57-
- source_labels: [__meta_kubernetes_pod_name]
58-
action: replace
59-
target_label: kubernetes_pod_name
60-
```
32+
```yml
33+
34+
- job_name: 'kubernetes-cpx'
35+
scheme: http
36+
metrics_path: /nitro/v1/config/systemfile
37+
params:
38+
args: ['filename:metrics_prom_ns_analytics_time_series_profile.log,filelocation:/var/nslog']
39+
format: ['prometheus']
40+
basic_auth:
41+
username: cpx # Prometheus username set in nsic.prometheusCredentialSecret
42+
password: cpx # Prometheus password set in nsic.prometheusCredentialSecret
43+
scrape_interval: 30s
44+
kubernetes_sd_configs:
45+
- role: pod
46+
relabel_configs:
47+
- source_labels: [__meta_kubernetes_pod_annotation_netscaler_prometheus_scrape]
48+
action: keep
49+
regex: true
50+
- source_labels: [__address__, __meta_kubernetes_pod_annotation_netscaler_prometheus_port]
51+
action: replace
52+
regex: ([^:]+)(?::\d+)?;(\d+)
53+
replacement: $1:$2
54+
target_label: __address__
55+
- source_labels: [__meta_kubernetes_namespace]
56+
action: replace
57+
target_label: kubernetes_namespace
58+
- source_labels: [__meta_kubernetes_pod_name]
59+
action: replace
60+
target_label: kubernetes_pod_name
61+
62+
```
6163

6264
**Note:**
6365
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).

0 commit comments

Comments
 (0)