rancher-partner-charts/charts/f5/nginx-service-mesh/configs/prometheus-config.yaml

73 lines
2.3 KiB
YAML

global:
scrape_interval: 10s
scrape_configs:
- job_name: 'nginx-mesh-sidecars'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_name]
action: keep
regex: nginx-mesh-sidecar
- action: labelmap
regex: __meta_kubernetes_pod_label_nsm_nginx_com_(.+)
- action: labeldrop
regex: __meta_kubernetes_pod_label_nsm_nginx_com_(.+)
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod
- job_name: 'nginx-plus-ingress'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_name]
action: keep
regex: nginx-plus-ingress
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
target_label: __address__
regex: (.+)(?::\d+);(\d+)
replacement: $1:$2
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: pod
- action: labelmap
regex: __meta_kubernetes_pod_label_nsm_nginx_com_(.+)
- action: labeldrop
regex: __meta_kubernetes_pod_label_nsm_nginx_com_(.+)
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: labelmap
regex: __meta_kubernetes_pod_annotation_nsm_nginx_com_enable_(.+)
metric_relabel_configs:
- source_labels: [__name__]
regex: 'nginx_ingress_controller_upstream_server_response_latency_ms(.+)'
target_label: __name__
replacement: 'nginxplus_upstream_server_response_latency_ms$1'
- source_labels: [__name__]
regex: 'nginx_ingress_nginxplus(.+)'
target_label: __name__
replacement: 'nginxplus$1'
- source_labels: [service]
target_label: dst_service
- source_labels: [resource_namespace]
target_label: dst_namespace
- source_labels: [pod_owner]
regex: '(.+)\/(.+)'
target_label: dst_$1
replacement: $2
- action: labeldrop
regex: pod_owner
- source_labels: [pod_name]
target_label: dst_pod