Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Can't change label for haproxy metrics in Prometheus

$
0
0

I have haproxy internal metrics page as a target for Prometheus. So I get many metrics like this

haproxy_server_http_responses_total{code="1xx",instance="haproxy:8404",job="other",proxy="http_back",server="rest1"}

I want this 'server' label value to be change from rest1 to rest-1 - just add a dash.So, I writed these line into Prometheus scrape config

- job_name: other    scrape_interval: 30s    honor_labels: true    metrics_path: /metrics    params:      match[]:        - '{__name__=~".+"}'    static_configs:      - targets:          - haproxy:8404           - source_labels: [server]        regex: '^(rest)([\d]+)'        replacement: 'rest-${2}'        target_label: server

But nothing happens.Moreover, if I do smth like this

  - source_labels: [job]    regex: '^other'    replacement: 'newvalue'    target_label: server2

It's ok - it creates new label server2

After some research I realized I can use any inernal labes for relabeling except those which were added by haproxy.

What I'm doing wrong? Maybe haproxy added label can not be relabled?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>