Add pct calculated fields for Pod and container CPU and memory usages#6158
Merged
ruflin merged 3 commits intoelastic:masterfrom Jan 28, 2018
Merged
Add pct calculated fields for Pod and container CPU and memory usages#6158ruflin merged 3 commits intoelastic:masterfrom
ruflin merged 3 commits intoelastic:masterfrom
Conversation
Contributor
|
@exekias Tests somehow fail on darwin. Probably need to skip it. |
ruflin
reviewed
Jan 25, 2018
Contributor
ruflin
left a comment
There was a problem hiding this comment.
LGTM. This PR also needs a CHANELOG.
| // PerfMetrics stores known metrics from Kubernetes nodes and containers | ||
| var PerfMetrics *PerfMetricsCache | ||
|
|
||
| const defaultTimeout = 120 * time.Second |
Contributor
There was a problem hiding this comment.
Should we make this configurable?
Contributor
Author
There was a problem hiding this comment.
It's a little tricky cause it's a global cache. I used a somehow safe value, I don't think someone needs to worry about it, what do you think?
Contributor
There was a problem hiding this comment.
Let's do it until it breaks :-)
walktall
reviewed
Jan 26, 2018
| ) | ||
|
|
||
| // PerfMetrics stores known metrics from Kubernetes nodes and containers | ||
| var PerfMetrics *PerfMetricsCache |
Contributor
There was a problem hiding this comment.
How about init it directly here
var PerfMetrics = NewPerfMetricsCache()
Contributor
Author
There was a problem hiding this comment.
Sounds good to me, pushed the change, thanks!
Contributor
Author
|
Thanks for the reviews! @ruflin this one should be ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the following set of calculated metrics for Pods and containers:
kubernetes.container.cpu.usage.node.pctkubernetes.container.cpu.usage.limit.pctkubernetes.container.memory.usage.node.pctkubernetes.container.memory.usage.limit.pctkubernetes.pod.cpu.usage.nanocoreskubernetes.pod.cpu.usage.node.pctkubernetes.pod.cpu.usage.limit.pctkubernetes.pod.memory.usage.byteskubernetes.pod.memory.usage.node.pctkubernetes.pod.memory.usage.limit.pctAs the source of data to calculate these values comes from different places (kubelet & kube-state-metrics) I added a mechanism to share some performance metrics through an in-memory cache. For that reason, these new metrics will only be available when
state_*metricsets are enabled.After talking with @simianhacker, I think this:
closes #6125
closes #6124
Please @simianhacker have a look and let me know if you need anything else