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

Allow ServiceMonitor/PodMonitor to set custom MatchLabels #2838

Open
yaron-idan opened this issue Apr 11, 2024 · 2 comments
Open

Allow ServiceMonitor/PodMonitor to set custom MatchLabels #2838

yaron-idan opened this issue Apr 11, 2024 · 2 comments
Labels
enhancement New feature or request needs triage

Comments

@yaron-idan
Copy link

Component(s)

collector

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

Currently, when the collector is creating podMonitors is using a predefined set of labels configured here. Since the pods we want to configure have different labels (as they are running a service the collector is only a sidecar of), the labels are not matched and the pods are not monitored.

Describe the solution you'd like

I'd like to inject a set of custom labels to any pod injected with the opentelemetry collector sidecar, and then match these labels in the podMonitor.

Describe alternatives you've considered

Creating the podMonitor manually.

Additional context

No response

@yaron-idan yaron-idan added enhancement New feature or request needs triage labels Apr 11, 2024
@iblancasa
Copy link
Contributor

Could it be a solution to add those labels + the ones you define for your OTEL Collector? Those labels could be propagated to the created PodMonitor and achieve what you want.

@yaron-idan
Copy link
Author

yaron-idan commented Apr 17, 2024

That could work but in order for the podMonitor to match arbitrary workloads injected with the sidecar there has to be a flag that allows omission of these labels (since labels like app.kubernetes.io/instance which are currently used are very common, and will probably be defined differently for each workload.

If that makes sense I can take a stab at implementing this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

2 participants