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

Please add __meta_kubernetes_pod_status so 'completed' pods can be dropped from scrape #4823

Closed
bboreham opened this Issue Nov 5, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@bboreham
Copy link
Contributor

bboreham commented Nov 5, 2018

Proposal

Use case. Why is this important?

Pods that are created by Kubernetes Job objects will go to Completed state if they finish without error.
Without a way to stop scraping, the Prometheus up state goes to 0 and (in my current environment) this triggers an alert.

The Kubernetes SD inserts various labels such as __meta_kubernetes_pod_annotation... which allow relabel config to drop some targets. I would like to extend this to a meta label which would hold the Completed status, so I can drop those pods from the targets.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Nov 5, 2018

We'll generally accept any metadata that's available, so feel free to send a PR.

@bboreham

This comment has been minimized.

Copy link
Contributor Author

bboreham commented Nov 5, 2018

Looking more closely, I find "Completed" comes from the (multiple) container.State.Terminated.Reason field, and requires gymnastics to obtain.
There is a simpler Phase field which will say Running, Succeeded, etc., and I propose to implement that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.