prometheus / prometheus/prometheus
Add proxy_url to targets as meta label
@TanayK07 is already working on this.
Since Mar 31, 2026.
- Dominant language
- Go
- Stars
- 66.1k
- Forks
- 10.8k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 131
Description
Problem
I'm working in a network topology of several local private networks which are connected to a global network via a host pc. For service discovery of my targets (the one in the privat networks as well as the host pcs) I use http SD. However, using the PushProx, I have to statically configure the proxy_url per job:
- job_name: "example_job"
proxy_url: http://host_pc:8080
http_sd_configs:
- url: "https://example_SD/local_targets"
This doesnt allow me to dynamically configure the proxies depending on the current state of my network topology.
Proposal
If the proxy url would be (also) passed as a meta label, I could add this url to my http SD and relabel it to cinfigure the proxy, something like this:
- job_name: "example_job"
http_sd_configs:
- url: "https://example_SD/local_targets"
relabel_configs:
- source_labels: [hostpc]
target_label: __proxy_url
replacement: 'http://${1}:8080'
My current approach is to write this dynamic part of the yaml with a script but this is of course a bit unconventional and not ideal.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.