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

Limit sample size for the pod collector #742

Open
0x2b3bfa0 opened this issue Jul 22, 2024 · 1 comment
Open

Limit sample size for the pod collector #742

0x2b3bfa0 opened this issue Jul 22, 2024 · 1 comment

Comments

@0x2b3bfa0
Copy link

0x2b3bfa0 commented Jul 22, 2024

Desired behavior

It would be nice to have an option to limit the sample size (i.e. number of sampled pods) for the pod collector:

metric-config.pods.queue-size.json-path/max-pod-sample-size: 1

Limiting the sample size to 1 will cause the pod collector to sample only one pod in the deployment (e.g. at random, or the first responsive one) and use the returned metric, instead of sampling all the pods.

This is useful when pods expose metrics that aren't pod-scoped, but come from a central database or queue system.

Equivalent workaround

Create a Kubernetes Service named e.g. example for the pods exposing the metrics endpoint, and then use it with the external metric collector like this:

      metric-config.external.datachain-queued-jobs.json-path/endpoint: http://example.studio.svc.cluster.local/metrics
@0x2b3bfa0 0x2b3bfa0 changed the title Add any aggregator for the pod collector Limit sample size for the pod collector Jul 25, 2024
@0x2b3bfa0
Copy link
Author

I've written an example implementation:

If there's any interest on upstreaming this, I'll open a polished pull request for review.

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