Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kube annotations scrape fixes #28

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

adamhackl
Copy link
Contributor

Problem: kubernetes/annotations/metrics.alloy won't load because the kubernetes discovery/relabel component references scrape_timeout and scrape_interval, which are not declared.

I think this is the intended solution to this. The scrape_timeout and scrape_interval should be set in the kubernetes section so that they are able to be replaced if a service sets the label to override. The scrape_timeout and scrape_interval should be removed from the prometheus.scrape components of the metrics section, so that both values can be set by the __scrape_timeout__ and __scrape_interval__ labels respectively, which should be set during discovery/relabel to either the default, the passed argument, or the overriding kube label.

Notated the same in the readme as well as fixed some incorrect references. I did verify this change in a running cluster by both setting an argument as well as setting a service label.

Copy link
Contributor

@Imshelledin21 Imshelledin21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this PR with Adam and walked through the changes he is suggesting here.
I think this all makes sense, as the scrape interval/timeouts will be set on the discovery phase, either through annotation, argument passed in, or the default 60s.

He's verified this working on his clusters as well.

@Imshelledin21 Imshelledin21 merged commit 83a5329 into grafana:main Aug 16, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants