Skip to content

feat: add cluster_name and cluster_peer labels to Prometheus metrics#436

Merged
apham0001 merged 1 commit intomainfrom
chore/prometheus-cluster-labels
Mar 6, 2026
Merged

feat: add cluster_name and cluster_peer labels to Prometheus metrics#436
apham0001 merged 1 commit intomainfrom
chore/prometheus-cluster-labels

Conversation

@apham0001
Copy link
Contributor

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 service

Add cluster_name and cluster_peer as external_labels in Prometheus
config so metrics sent via remote_write include the same identity
labels already used by Alloy for logs.
@apham0001 apham0001 merged commit 7161421 into main Mar 6, 2026
3 checks passed
@apham0001 apham0001 deleted the chore/prometheus-cluster-labels branch March 6, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants