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

Update Label Selector Functionality in Target Allocator for Parity with Prometheus Operator #3467

Open
michael-burt opened this issue Nov 15, 2024 · 1 comment
Labels
area:target-allocator Issues for target-allocator question Further information is requested

Comments

@michael-burt
Copy link

Component(s)

target allocator

Is your feature request related to a problem? Please describe.

Complex Prometheus deployments often include metrics sourced from different systems, including high-cardinality metrics producers such as Istio. In these environments, it is often desirable to exclude specific ServiceMonitors & PodMonitors based on the existence of labels, eg app: istio. In my specific use case, we collect Istio metrics with a dedicated Prometheus, aggregate away high cardinality labels via recording rules, and make these derived metrics available in other backends while dropping the high cardinality metrics. This is accomplished by using matchExpressions functionality of Label Selectors in Prometheus Operator. We tell Prometheus to scrape all metrics except Istio.

This functionality is not available in the existing Target Allocator label selector. Target Allocator uses a naive selector that requires a user to specify every ServiceMonitor/PodMonitor via labels, or it consumes all ServiceMonitors and PodMonitors present in the cluster. It does not allow a user to exclude a subset of ServiceMonitors and PodMonitors.

Describe the solution you'd like

As a user, I would like to leverage the same flexible label selector syntax available in Prometheus Operator. This would facilitate migrations from complex Prometheus deployments to Target Allocator by providing feature parity with resource selection.

Describe alternatives you've considered

An alternative approach would be to declare every label:value combination you would like to Target Allocator to watch. This is not a good solution for complex platforms with many users who are deploying ServiceMonitors and PodMonitors with various labels.

Another alternative is to drop all metrics originating from the ServiceMonitor or PodMonitor you would like to exclude. This is a suboptimal solution because it consumes resources unnecessarily.

Additional context

No response

@michael-burt michael-burt added enhancement New feature or request needs triage labels Nov 15, 2024
@jaronoff97
Copy link
Contributor

@michael-burt i believe we already support this by using the labelSelector objects here for posterity, this is that type

@jaronoff97 jaronoff97 added question Further information is requested area:target-allocator Issues for target-allocator and removed enhancement New feature or request needs triage labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:target-allocator Issues for target-allocator question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants