-
Notifications
You must be signed in to change notification settings - Fork 482
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
Unable to configure servicemonitorselector under prometheusCR under targetallocator section #1907
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I believe this issue belongs in https://github.com/open-telemetry/opentelemetry-operator. The prometheus receiver doesn't interact with ServiceMonitors in any way - in the otel ecosystem, the Target Allocator does this. |
@swiatekm-sumo Technically yes, the target allocator is deployed when opentelemetry collector CR is created and when we make targetallocator enabled. And in this case we are making TA enabled: true in kube-otel-stack and PrometheusCR is part of TA in kubeotelstack. https://github.com/lightstep/otel-collector-charts/blob/main/charts/kube-otel-stack/values.yaml#L141 Also here is my values.yam file
|
As per the documentation, serviceMonitorSelector:
matchLabels:
"lightstep-metrics-collector"
#"translation-service-monitor"
# "document-translation"
# "nmt-engines-monitor"
# "document-translation-servicemonitor"
# "lightstep-operator"
# "lightstep-metrics-collector" won't work. I can't exactly tell what you want to do here, but the following will work: serviceMonitorSelector:
app: document-translation I do agree that this is limiting, and we should consider using the standard selector mechanism just as prometheus-operator does. WDYT @jaronoff97 ? |
Yep, this is an oversight on my part – my initial implementation was a stop gap solution for someone at the time, im not sure why i didn't go with what prometheus does. This is a good first issue for anyone who wants to take it... We can support both implementations, deprecating the old one and eventually removing it. |
This will result in a breaking change and is this included in our v2 milestone. |
has this been completed in the v2 version? anywhere that I can pick up from? |
@Toaddyan not yet, but i think @yuriolisa is working on this? |
sounds good. lmk! |
@yuriolisa that change is only internal for now, this issue will be resolved in |
Component(s)
receiver/prometheus
Describe the issue you're reporting
Since scraping prometheus CR servicemonitor endpoints without any selection consume too much memory and drops the data , we decide to only scrape selected servicemonitor using serviceMonitorSelector option provided by opentelemtry crd from opentelemetry operator which we are using here in kueb-otel-stack - https://github.com/lightstep/otel-collector-charts/blob/main/charts/kube-otel-stack/values.yaml#L146
I read and found out that we can specify the and limit the number of servicemonitor that we want to scrape for metrics using "serviceMonitorSelector" (https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/crds/crd-opentelemetrycollector.yaml#L2039) which can reduce the memory consumption i believe as it will reduce the no of scraping endpoints.
As described in opentelemetrycollector crd, this is parameter is of type string but at the same time it is written that it is key value pair. And as per the kube-prometheus-stack i should configue like - https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2975
But when the same way when i try to configure multiple servicemonitor with matchLabel and its key value pair it kube-otel-stack deployment fails.
Hence i tried to configure as below ## Default collector for metrics (includes infrastructure metrics) metricsCollector: name: metrics clusterName: dev image: otel/opentelemetry-collector-contrib:0.73.0 enabled: true mode: statefulset replicas: 6 targetallocator: enabled: true allocationStrategy: "consistent-hashing" filterStrategy: relabel-config replicas: 2 image: ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:0.73.0 prometheusCR: enabled: true serviceMonitorSelector: matchLabels: "lightstep-metrics-collector"
But the things is , i can only specify one servicemonitor this way, how can i configure multiple servicemonitor?
The text was updated successfully, but these errors were encountered: