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

[receiver/kubeletstats] Add k8s.pod.cpu.node.utilization metric #33390

Merged
merged 11 commits into from
Jun 14, 2024

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jun 5, 2024

Description:

This PR adds the k8s.pod.cpu.node.utilization metric.
Follow up from #32295 (comment) (cc @TylerHelmuth) .

Link to tracking Issue:
Related to #27885.

Testing: Adjusted the respective unit test to cover this metric as well.

Documentation: Added

Tested with a single container Pod:

podCpu

@ChrsMark ChrsMark requested a review from a team June 5, 2024 09:03
@ChrsMark ChrsMark force-pushed the add_k8s_pod_utilization branch 4 times, most recently from 0829cbb to 49f4e75 Compare June 5, 2024 10:07
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark force-pushed the add_k8s_pod_utilization branch from 49f4e75 to 9e43537 Compare June 7, 2024 07:32
Copy link
Contributor

@rogercoll rogercoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TylerHelmuth TylerHelmuth merged commit 8522b4e into open-telemetry:main Jun 14, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 14, 2024
andrzej-stencel pushed a commit that referenced this pull request Jul 10, 2024
…ion` metrics (#33591)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Similar to
#32295
and
#33390,
this PR adds the `k8s.{container,pod}.memory.node.utilization` metrics.


**Link to tracking Issue:** <Issue number if applicable>
#27885

**Testing:** <Describe what testing was performed and which tests were
added.> Added unit test.

**Documentation:** <Describe the documentation added.> Added

### Manual testing

1. Using the following target Pod:
```yaml
apiVersion: v1
kind: Pod
metadata:
  name: memory-demo
spec:
  containers:
  - name: memory-demo-ctr
    image: polinux/stress
    resources:
      requests:
        memory: "8070591Ki"
      limits:
        memory: "9070591Ki"
    command: ["stress"]
    args: ["--vm", "1", "--vm-bytes", "800M", "--vm-hang", "4"]
```
2. 

![memGood](https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/11754898/fae04b30-59ca-4d70-8446-f54b5a085cf7)

On a node of 32,5G memory the 800Mb container/Pod consumes the
`0.8/32.5=0.0246...=0.025`.

---------

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants