Adding extra lable to all prometheus metrics

17 views
Skip to first unread message

Sandeep Rao Kokkirala

unread,
Jul 1, 2020, 4:57:25 AM7/1/20
to Prometheus Users
Hi Team,

I want to display clustername for my all prometheus queries. Tried  adding below two scrape configs but getting the same output. 

    additionalScrapeConfigs:
      - job_name: 'local'
        honor_labels: true
        static_configs:
        - targets:
          - '<ip>:<nodePort>'
          labels:
            cluster: 'qa-app'

  additionalScrapeConfigs:
      - job_name: 'local'
        honor_labels: true
        static_configs:
        - targets:
          - '127.0.0.1'
          labels:
            cluster: 'qa-app'


query:

up{job="apiserver"}

Output:

Currentoutput:
up{endpoint="https",instance="<ip>:6443",job="apiserver",namespace="default",service="kubernetes"} 1

Expected output:
up{cluster: 'qa-app',endpoint="https",instance="<ip>:6443",job="apiserver",namespace="default",service="kubernetes"} 1



Reply all
Reply to author
Forward
0 new messages