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 new memory utilization metrics #25894

Merged

Conversation

TylerHelmuth
Copy link
Member

Description:
Adds new k8s.pod.memory.utilization and container.memory.utilization metrics that represent the ratio of memory used vs limits set.

The metrics are only emitted for pods/containers that have defined resource limits. It takes advantage of the pod metadata to acquire the container limits. A pod limit is computed as the sum of all the container limits and if any container limit is zero or undefined the pod limit is also considered undefined.

Link to tracking Issue:
Related to #24905

Testing:
Unit tests and local testing

@dmitryax
Copy link
Member

A good comment was brought in the issue: #24905 (comment). Let's discuss that first.

@dmitryax dmitryax closed this Aug 28, 2023
@dmitryax dmitryax reopened this Aug 28, 2023
@TylerHelmuth
Copy link
Member Author

@dmitryax if you feel good about the memory_limit and memory_request naming I can update this PR.

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Sep 12, 2023
@dmitryax
Copy link
Member

if you feel good about the memory_limit and memory_request naming I can update this PR.

SGTM

@TylerHelmuth
Copy link
Member Author

@dmitryax updated the names and implemented requests logic.

@TylerHelmuth TylerHelmuth changed the title [receiver/kubeletstats] Add new memory.utilization metrics [receiver/kubeletstats] Add new memory utilization metrics Sep 12, 2023
@github-actions github-actions bot removed the Stale label Sep 13, 2023
@TylerHelmuth
Copy link
Member Author

@dmitryax to make this an easier review process I created #26690 to isolate the new metadata gathering logic.

@TylerHelmuth
Copy link
Member Author

@dmitryax this is ready for a proper review.

@TylerHelmuth
Copy link
Member Author

@dmitryax ready for review

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

👍

@TylerHelmuth TylerHelmuth merged commit 7455498 into open-telemetry:main Sep 29, 2023
91 checks passed
@TylerHelmuth TylerHelmuth deleted the kubeletstats-memory-utilization branch September 29, 2023 17:23
@github-actions github-actions bot added this to the next release milestone Sep 29, 2023
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this pull request Nov 12, 2023
…metry#25894)

**Description:**
Adds new `k8s.pod.memory.utilization` and `container.memory.utilization`
metrics that represent the ratio of memory used vs limits set.

The metrics are only emitted for pods/containers that have defined
resource limits. It takes advantage of the pod metadata to acquire the
container limits. A pod limit is computed as the sum of all the
container limits and if any container limit is zero or undefined the pod
limit is also considered undefined.

**Link to tracking Issue:**
Related to
open-telemetry#24905

**Testing:**
Unit tests and local testing
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.

4 participants