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
Annotate kube objects monitored via prometheus #230
Comments
The Prometheus Operator does not know of all Kube objects that are monitored by a Prometheus. They might not all be specified via the ServiceMonitor ThirdPartyRessource but via the Prometheus Config itself. Maybe this could live in a separate tool which scrapes the Prometheus Target API and applies the Annotation to the corresponding objects. |
The difficulty here is that Prometheus would need to know about all Pods and all monitored Pods and constantly add the annotation for the union of those and remove them for the inverted union, as when Prometheus doesn't monitor them anymore, then the annotation would need to be removed. The Prometheus Operator doesn't know anything about the targets that the actual Prometheus instance scrapes. So I agree with @mxinden that this should probably live in a separate tool, I'm happy to give it a home under |
Thanks folks! I am going to look into the Targets API. |
For now I think we can close this as it won't go into the main Operator code base, feel free to open a PR if you would like to add such a tool to |
…sistency-openshift-4.14-prometheus-config-reloader OCPBUGS-12324: Update 4.14 prometheus-config-reloader image to be consistent with ART
In our kube dashboard, we would like to know whether metrics for a particular Kube object is collected by Prometheus or not. We think that one easy way to do that will be the operator to apply "monitored-by:" annotation to Kube objects. We want to annotate any workload object type that matches from service labels.
What do you think about this idea? Do you think this can be done from Prometheus operator?
cc: @aerokite
The text was updated successfully, but these errors were encountered: