kubernetes-sigs / prometheus-adapter

An implementation of the custom.metrics.k8s.io API using Prometheus
Apache License 2.0
1.93k stars 553 forks source link

Feature: Honor resource limits for CPU and memory #682

Open jabbrwcky opened 3 weeks ago

jabbrwcky commented 3 weeks ago

Hi,

when running the adapter in my cluster I often get OOM-Kills because of a runaway resource consumption.

It would be nice if prometheus-adapter would honor configured resource limits, so it is more stable to operate.

The simplest way would be to use https://github.com/uber-go/automaxprocs for CPU limits and https://github.com/KimMachineGun/automemlimit for memory resource limits.

Depending on how much configurability is required (both default to NOOP if no (cgroup) limits are configured) the integration complexity ranges form two _-imports to adding three flags (enabling each feature + configuring percentage of memory quota used for go process)

I'd be happy to add the required functionality, but I'd first like to see what meets the project requirements.

k8s-ci-robot commented 3 weeks ago

This issue is currently awaiting triage.

If prometheus-adapter contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.