grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
968 stars 103 forks source link

[prometheus.operator.probes] Add namespace label with the namespace of the probe object #1058

Open ToonTijtgat2 opened 1 week ago

ToonTijtgat2 commented 1 week ago

PR Description

Add namespace label with the namespace of the probe object in the static config to align with prometheus setup. Prometheus automatically adds the namespace label, and since this is standard practice and we rely on this label for some dashboards and rules, we'd like to align the prometheus setup and alloy setup.

Which issue(s) this PR fixes

Fixes #1049

Notes to the Reviewer

PR Checklist

ToonTijtgat2 commented 1 week ago

@thampiotr Thanks for running the tests, I adapted the code a little according to the results. Can you try again? Thanks

ToonTijtgat2 commented 1 week ago

@thampiotr Thanks for running the tests again, for the failing results on this one, I'm not sure what the issues are or how to solve them.

ToonTijtgat2 commented 1 week ago

@thampiotr Noticed that the probe config tests are not successful, so added the expectation of a label with name namespace and value default.

ToonTijtgat2 commented 1 week ago

@thampiotr I changed the labelset from an array of sets to one object.

ToonTijtgat2 commented 5 days ago

@thampiotr, Is there something else for the moment I can do? (not sure how the full PR flow works) Thanks for checking

ToonTijtgat2 commented 5 days ago

@thampiotr Adapted the test to have one list instead of a list in a list

thampiotr commented 5 days ago

@ToonTijtgat2 you should be able to run most of the tests locally with make test, there are also some contribution docs in the repository you may find helpful. I intend to take a closer review once we have tests passing.