Prometheus relabeling

31 views
Skip to first unread message

Zhang Zhao

unread,
Jan 5, 2021, 4:43:06 PM1/5/21
to Prometheus Users
Hi, 
Anyone can guide me why I was not able to see this job below on Prometehus?

kubectl get pod pharmacy-deployment-55dd8c5d6b-gr5rp -o jsonpath='{.metadata.annotations}' -n aais-dev

{"prometheus.io/path":"/aais-pharmacy/management/prometheus","prometheus.io/port":"8080","prometheus.io/scrape":"true","prometheus.istio.io/merge-metrics":"false","sidecar.istio.io/status":"{\"version\":\"8e6e902b765af607513b28d284940ee1421e9a0d07698741693b2663c7161c11\",\"initContainers\":[\"istio-init\"],\"containers\":[\"istio-proxy\"],\"volumes\":[\"istio-envoy\",\"istio-data\",\"istio-podinfo\",\"istio-token\",\"istiod-ca-cert\"],\"imagePullSecrets\":null}"}%



- job_name: 'kubernetes-micrometer'
kubernetes_sd_configs:
- role: pod
relabel_configs:
# "prometheus.io/scrape = true" annotation.
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
# "prometheus.io/path = <metric path>" annotation.
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
# "prometheus.io/port = <port>" annotation.
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?(\d+)
replacement: $1:8080
target_label: __address__
- 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_name
Reply all
Reply to author
Forward
0 new messages