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

Check for explicit label or metadata to include a pod in accounting #46

Open
rptaylor opened this issue Apr 24, 2024 · 1 comment
Open

Comments

@rptaylor
Copy link
Owner

rptaylor commented Apr 24, 2024

Currently all pods in a selected namespace are accounted.

If we can use a prometheus query that will e.g. only count pods with a certain label or annotation it would be a more explicit opt-in. Or maybe (possibly less preferable) only account pods with a given name prefix (e.g. atlas-harvester-*).

@rptaylor
Copy link
Owner Author

rptaylor commented Apr 24, 2024

Here are pod metrics:
https://github.com/kubernetes/kube-state-metrics/blob/main/docs/metrics/workload/pod-metrics.md

There is a completely different metric kube_pod_labels but only if --metric-labels-allowlist is configured. Also there would need to be some joining statement.

It might be better to set a scrapeconfig rule in Prometheus to ensure that Prometheus only contains the metrics of pods that you want to account.

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

1 participant