Commit 7161421
authored
feat: add cluster_name and cluster_peer labels to Prometheus metrics (#436)
## Summary
- Add `cluster_name` and `cluster_peer` as `external_labels` in
Prometheus config
- These labels are already used by Alloy for logs but were missing from
metrics sent via `remote_write`
- Pass `CLUSTER_NAME` and `CLUSTER_PEER` env vars to the Prometheus
container in docker-compose
- Render the new variables in `run.sh` via `sed` (same pattern as
existing vars)
## Changes
- `prometheus/prometheus.yml.example` — add `cluster_name` and
`cluster_peer` external labels
- `prometheus/run.sh` — render `$CLUSTER_NAME` and `$CLUSTER_PEER` via
sed
- `docker-compose.yml` — pass `CLUSTER_NAME` and `CLUSTER_PEER` env vars
to prometheus service1 parent 2246970 commit 7161421
3 files changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
0 commit comments