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

Annotate kube objects monitored via prometheus #230

Closed
tamalsaha opened this issue Mar 24, 2017 · 4 comments
Closed

Annotate kube objects monitored via prometheus #230

tamalsaha opened this issue Mar 24, 2017 · 4 comments

Comments

@tamalsaha
Copy link
Contributor

tamalsaha commented Mar 24, 2017

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

@mxinden
Copy link
Contributor

mxinden commented Mar 24, 2017

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.

@brancz
Copy link
Contributor

brancz commented Mar 24, 2017

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 contrib/ if you want, but I'm unsure whether it's suitable to be part of the main Operator code base and binary.

@tamalsaha
Copy link
Contributor Author

Thanks folks! I am going to look into the Targets API.

@brancz
Copy link
Contributor

brancz commented Mar 24, 2017

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 contrib/. And we're still around if you have any further questions 🙂

@brancz brancz closed this as completed Mar 24, 2017
simonpasquier pushed a commit to simonpasquier/prometheus-operator that referenced this issue May 5, 2023
…sistency-openshift-4.14-prometheus-config-reloader

OCPBUGS-12324: Update 4.14 prometheus-config-reloader image to be consistent with ART
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants