Repository navigation
fix(alloy): scrape all alloy pod targets on the Alloy HTTP port - #90
Merged
Merged
Conversation
This was referenced Oct 16, 2026
Pod discovery makes one scrape target for each declared container port. It makes a target on port 80 for containers that declare no port, such as config-reloader. Alloy does not listen on port 80, so the config-reloader target is always down. Set the prometheus.io/port annotation on the Alloy pod to the Alloy HTTP port by default. Operators no longer need to set it in their own values.
jtslear
force-pushed
the
skarbek/alloy-default-port-annotation
branch
from
October 16, 2026 15:04
443c4f9 to
e704cdd
Compare
jtslear
marked this pull request as ready for review
October 16, 2026 15:35
dannykopping
approved these changes
Oct 19, 2026
Collaborator
|
Appreciate the follow-up here! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set
prometheus.io/port: "12345"on the Alloy pod by default.Review of coder/dogfood#702 (v0.8.0 bump) asked for dogfood settings to become chart defaults. Dogfood sets this annotation in its own values. Source: https://github.com/coder/dogfood/pull/702#pullrequestreview-5547941289
Why
Pod discovery makes one scrape target for each declared container port. It makes a target on port 80 for containers that declare no port. Alloy listens on 12345, not 80, so
up{job="<ns>/alloy/config-reloader"}is always 0. The annotation points every target of the pod at the Alloy HTTP port.Test
Kind cluster tested, baseline is
mainwith default values.up{pod=~"alloy.*"}mainalloy/alloy= 1,alloy/config-reloader= 0alloy/alloy= 1,alloy/config-reloader= 1Method:
helm upgradewith the local chart, wait for the DaemonSet rollout, query Prometheus.Notes
config-reloadertarget now scrapes Alloy's own/metrics. Its series are a copy of thealloyjob under anotherjoblabel. Raised in https://github.com/coder/dogfood/pull/702#discussion_r4286919738 and left as is.alloy.alloy.listenPort. Helm values cannot reference each other, so a comment records this.compiled/resources.yamlregenerated withmake build.