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

Export images as Prometheus metrics #28

Open
ArjonBu opened this issue May 27, 2021 · 5 comments
Open

Export images as Prometheus metrics #28

ArjonBu opened this issue May 27, 2021 · 5 comments
Labels
enhancement New feature or request PM-review

Comments

@ArjonBu
Copy link

ArjonBu commented May 27, 2021

What would you like to be added:
Add a metrics endpoint to expose currently running images as Prometheus metrics

Why is this needed:
Nice to have. We could use this information for other purposes outside Anchore.

@ArjonBu ArjonBu added the enhancement New feature or request label May 27, 2021
@ArjonBu ArjonBu changed the title Export images as prometheus metrics Export images as Prometheus metrics May 27, 2021
@dakaneye
Copy link
Contributor

@ArjonBu thanks for the feature suggestion. To clarify, are you requesting a metrics endpoint on the Anchore service? Or a flag that can be provided to kai such that the output of the images matches something that can be imported into Prometheus?

@ArjonBu
Copy link
Author

ArjonBu commented May 28, 2021

@dakaneye a metrics endpoint on KAI which can be scrapped by Prometheus. This metrics endpoint should show the same info that KAI sends to Anchore (image, namespace of the image, etc...)

@zburstein
Copy link

@ArjonBu Thanks for suggesting the feature! I have submitted the request to PM for review

@zhill
Copy link
Member

zhill commented Aug 6, 2021

@ArjonBu, I'm not quite sure I understand the specific suggestion. Is the ask for a metric value for each image? For example a metric label "centos:latest" with integer value 1 indicating that one image with that tag is running, and another metric "debian:latest" with 3, for 3 images running in the namespace with that tag.

Prometheus metrics are typically numeric, whereas KAI reports a list of names that can change on each invocation, so the metrics, if keyed by the image name or digest, would be dynamic. If that is ok then I understand the ask. Just looking for what you would want to graph in Grafana, for example. That would help clarify. Thanks!

@ArjonBu
Copy link
Author

ArjonBu commented Aug 7, 2021

The metric would have labels for the deployment name (if possible), image tag, namespace and cluster name with the value 1.
Generally all metrics would have the value 1.

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

No branches or pull requests

4 participants