Skip to content

feature: extract label matchers from the prometheus-rules labels #3175

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

QuentinBisson
Copy link
Contributor

PR Description

This pull request introduces enhances the mimir.rules.kubernetes component by adding extra label matchers to queries and improving the validation logic. Additionally, it includes updates to the test cases to cover these new functionalities.

Which issue(s) this PR fixes

Fixes #3172

Notes to the Reviewer

I tried to implement the field selector approach in the component but I could not really see how it can work. Considering the only fields that would be useful are the rule name, namespace, labels and annotations, maybe we should add a valueFromName,valueFromNamespace and valueFromAnnotation instead of a field selector?

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@QuentinBisson QuentinBisson force-pushed the feat-add-extra-query-matcher-extraction-from-label branch from 41dce1e to afc3668 Compare April 2, 2025 18:26
@CLAassistant
Copy link

CLAassistant commented Apr 2, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@dehaansa dehaansa left a comment

Choose a reason for hiding this comment

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

Functionality looks good, one documentation request.

@QuentinBisson
Copy link
Contributor Author

By the way, do you think it would make sense to add this feature (extraQueryMatchers) to loki.rules.kubernetes as well?
I think it does but I'm not sure how I can differentiate between a query matcher ({key:value}) and structured medata ({} | key=value)

Do you think adding a Boolean (is_structrued_metadata) would work?

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Apr 7, 2025
Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Approving for docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
5 participants