Add Kubernetes pod name to metrics discovered from service endpoints
* Prometheus queries from some upstreams use joins of node-exporter and kube-state-metrics metrics by (namespace,pod). Add the Kubernetes pod name to service endpoint metrics * Rename the kubernetes_namespace field to namespace * Honor labels since kube-state-metrics already include a `pod` field that should not be overridden
This commit is contained in:
parent
3e4b3bfb04
commit
9c59f393a5
|
@ -10,6 +10,9 @@ Notable changes between versions.
|
||||||
#### Addons
|
#### Addons
|
||||||
|
|
||||||
* Raise nginx-ingress liveness/readiness timeout to 5 seconds
|
* Raise nginx-ingress liveness/readiness timeout to 5 seconds
|
||||||
|
* Improve Prometheus metrics labels
|
||||||
|
* Add `pod` name label to metrics discovered via service endpoints
|
||||||
|
* Rename `kubernetes_namespace` label to `namespace`
|
||||||
|
|
||||||
## v1.13.3
|
## v1.13.3
|
||||||
|
|
||||||
|
|
|
@ -119,10 +119,10 @@ data:
|
||||||
# * `prometheus.io/port`: If the metrics are exposed on a different port to the
|
# * `prometheus.io/port`: If the metrics are exposed on a different port to the
|
||||||
# service then set this appropriately.
|
# service then set this appropriately.
|
||||||
- job_name: 'kubernetes-service-endpoints'
|
- job_name: 'kubernetes-service-endpoints'
|
||||||
|
|
||||||
kubernetes_sd_configs:
|
kubernetes_sd_configs:
|
||||||
- role: endpoints
|
- role: endpoints
|
||||||
|
|
||||||
|
honor_labels: true
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
|
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
|
||||||
action: keep
|
action: keep
|
||||||
|
@ -144,7 +144,10 @@ data:
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
regex: __meta_kubernetes_service_label_(.+)
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
action: replace
|
action: replace
|
||||||
target_label: kubernetes_namespace
|
target_label: namespace
|
||||||
|
- source_labels: [__meta_kubernetes_pod_name]
|
||||||
|
action: replace
|
||||||
|
target_label: pod
|
||||||
- source_labels: [__meta_kubernetes_service_name]
|
- source_labels: [__meta_kubernetes_service_name]
|
||||||
action: replace
|
action: replace
|
||||||
target_label: job
|
target_label: job
|
||||||
|
@ -177,7 +180,7 @@ data:
|
||||||
- action: labelmap
|
- action: labelmap
|
||||||
regex: __meta_kubernetes_service_label_(.+)
|
regex: __meta_kubernetes_service_label_(.+)
|
||||||
- source_labels: [__meta_kubernetes_namespace]
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
target_label: kubernetes_namespace
|
target_label: namespace
|
||||||
- source_labels: [__meta_kubernetes_service_name]
|
- source_labels: [__meta_kubernetes_service_name]
|
||||||
target_label: job
|
target_label: job
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue