Skip to content

Commit 8e8a940

Browse files
Add example of how to scrape prometheus from the agent. (#75)
Co-authored-by: Arne Mejlholm <arne.mejlholm@subaio.com>
1 parent 372c414 commit 8e8a940

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ docker run --rm -p 8083:8083 -p 8093:8093 \
306306
**Note:** The `WORKDIR` of the proxy and agent images is `/app`, so make sure to use `/app` as the base directory in the
307307
target for `--mount` options.
308308

309+
## Scraping a prometheus instance
310+
It's possible to scrape an existing prometheus server using the /federate endpoint.
311+
This enables using the existing service discovery features already built into prometheus.
312+
313+
An example config can be found in
314+
[federate.conf](https://raw.githubusercontent.com/pambrose/prometheus-proxy/master/examples/federate.conf)
315+
316+
309317
## Grafana
310318

311319
[Grafana](https://grafana.com) dashboards for the proxy and agent

examples/federate.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
agent {
2+
pathConfigs: [
3+
{
4+
name: "Federate metrics"
5+
path: federate_metrics
6+
url: "http://prometheus:9090/federate?match[]={job=~'.*'}"
7+
},
8+
{
9+
name: "Agent metrics"
10+
path: agent_metrics
11+
url: "http://localhost:8083/metrics"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)