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

Include resource requests and limits in kubernetes plugin output for containers #8565

Open
philomory opened this issue Dec 15, 2020 · 2 comments
Labels
area/k8s feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution size/l 1 week or more effort

Comments

@philomory
Copy link
Contributor

Feature Request

I'd like the kubernetes input plugin to include the resource limits and requests as fields in the kubernetes_pod_container measurement.

Proposal:

The kubernetes input should include resource limits and requests in the kubernetes_pod_container measurement. Currently, the only way to get this information is to also run the kube_inventory input plugin, however, this is sub-optimal for a few reasons:

  1. The kube_inventory plugin doesn't apply the same pod-specific tags that the kubernetes plugin does (see Handle labels in kube_inventory input like the kubernetes input does #8546)
  2. Running the kube_inventory plugin means making a bunch of extra API requests, even if the only additional information you're looking for is the resource limits.
  3. The kubernetes plugin is already fetching all of the necessary information as part of the same API request with which it gets the pod labels, names, etc. It just doesn't include the information in the emitted metrics.

Current behavior:

Resource usage comes from the kubernetes plugin, and resource requests/limits come from the kube_inventory plugin.

Desired behavior:

I can get resource usage and resource requests from a single plugin.

Use case:

If I want to compare container resource usage against resource limits and requests, I have to use two different input plugins. These two plugins tag their emitted metrics differently, and so they can't be combined with pivot, instead requiring otherwise-unecessary joins in InfluxDB when querying.

Leaving aside the question of whether it's necessary to have two different plugins for different subsets of Kubernetes metrics (I could go either way on that), I think resource limits and requests should be part of the same measurement as resource usage; it's very likely you'll want to work on these two fields at the same time, so it's useful to have them in the same plugin so they get the same tags, the same timestamps, etc.

@philomory philomory added the feature request Requests for new plugin and for new features to existing plugins label Dec 15, 2020
@powersj powersj added the help wanted Request for community participation, code, contribution label Mar 28, 2022
@powersj
Copy link
Contributor

powersj commented Mar 28, 2022

next steps: look to make the above changes so users do not need to run both plugins

@sspaink
Copy link
Contributor

sspaink commented Aug 8, 2022

Related issue: #9451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/k8s feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution size/l 1 week or more effort
Projects
None yet
Development

No branches or pull requests

4 participants