Prometheus Agent 2.51.1 - remote_write - write_relabel_configs

32 views
Skip to first unread message

Alexander Wilke

unread,
Apr 17, 2024, 3:51:57 AM4/17/24
to Prometheus Users
Hello,

i have several prometheus agents doing remote write to another central prometheus Agent.
on this central prometheus agent I Do two remote_rewrite to two destinations.

Destination A should receive all metrics, this seems to work.
Destination B should only receive metrics from specific jobs.

the job names are:
windows_exporter
node_exporter

I tried several combinations but it looks like I still send all metrics to destination B:

In the example below there is only destination B.





remote_write:

- url: "https://prometheus-q.domain.de:9009/api/v1/push"

basic_auth:

username: "tenant_02"

password: "tenant_02"

queue_config:

min_shards: 3

write_relabel_configs:

- source_labels: [job]

regex: "node_exporter"

action: keep

- source_labels: [job]

regex: "windows_exporter"

action: keep

- source_labels: [job]

regex: ".*"

action: drop

Alexander Wilke

unread,
Apr 17, 2024, 5:47:00 AM4/17/24
to Prometheus Users
Hello,

don't know exactly what the issue was - however this  is working now. Probably a visulization issue on my site with (bad) grafana query I used.


remote_write:

- url: "https://prometheus-q.domain.de:9009/api/v1/push"

basic_auth:

username: "tenant_02"

password: "tenant_02"

queue_config:

min_shards: 3

write_relabel_configs:

- source_labels: [job]

regex: "(node_exporter|windows_exporter)"

action: keep
Reply all
Reply to author
Forward
0 new messages