Ability to disable Prometheus scrape annotations #2554
Labels
area:collector
Issues for deploying collector
enhancement
New feature or request
good first issue
Good for newcomers
Component(s)
Collector
Is your feature request related to a problem? Please describe.
When creating an opentelemetry collector, I noticed that the operator always creates the deployments with the following annotations:
I had a look at the code, and it looked to me like they are hardcoded in
internal/manifests/collector/annotations.go
In my environment, I am using a servicemonitor to scrape the collector, so I don't want to have those annotations, otherwise I will have 2 jobs scraping my pod.
I found a workaround to disable the annotations scraping. I am overriding the pod annotations using:
This works, however it doesn't look clean because now annotations are inconsistent between deployment and pod:
Describe the solution you'd like
A flag in the collector spec should do the trick to eventually enable/disable these annotations.
Describe alternatives you've considered
A more sophisticated solution would be to give the possibility to choose between these annotations or a servicemonitor created by the opentelemetry operator.
Additional context
Please, ask if it is not clear
The text was updated successfully, but these errors were encountered: