grafana / alloy-modules

Apache License 2.0
21 stars 11 forks source link

Kube annotations scrape fixes #28

Closed adamhackl closed 3 months ago

adamhackl commented 5 months ago

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.