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

Add container.cpu.usage metric #1128

Merged
merged 13 commits into from
Aug 5, 2024

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jun 6, 2024

Related to #1032

Changes

This PR adds the container.cpu.usage metric.
This metric is implemented by the kubeletstats receiver.
This value comes from the stats/summary endpoint of Kubelet and its calculated at https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/kubelet/stats/cri_stats_provider.go#L791-L800.

It's not implemented by the dockerstats receiver but that would be doable with something similar to https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.102.0/receiver/dockerstatsreceiver/metric_helper.go#L30, using the formula from the Kubelet's stats mentioned above.

ref: https://docs.docker.com/engine/api/v1.45/#tag/Container/operation/ContainerStats

Merge requirement checklist

/cc @open-telemetry/semconv-container-approvers @open-telemetry/semconv-k8s-approvers

@ChrsMark ChrsMark requested review from a team June 6, 2024 12:00
@ChrsMark ChrsMark requested review from a team June 6, 2024 12:01
@ChrsMark ChrsMark self-assigned this Jun 6, 2024
model/metrics/container.yaml Show resolved Hide resolved
model/metrics/container.yaml Show resolved Hide resolved
model/metrics/container.yaml Outdated Show resolved Hide resolved
model/metrics/container.yaml Outdated Show resolved Hide resolved
model/metrics/container.yaml Outdated Show resolved Hide resolved
model/metrics/container.yaml Outdated Show resolved Hide resolved
@ChrsMark ChrsMark force-pushed the add_container_cpu_usage branch 2 times, most recently from 15e0e08 to dab7f82 Compare June 26, 2024 11:22
Copy link

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

@github-actions github-actions bot added the Stale label Jul 12, 2024
model/metrics/container.yaml Show resolved Hide resolved
@github-actions github-actions bot removed the Stale label Jul 13, 2024
@ChrsMark
Copy link
Member Author

@open-telemetry/semconv-k8s-approvers @open-telemetry/semconv-container-approvers @open-telemetry/specs-semconv-approvers could you take a look?

@ChrsMark
Copy link
Member Author

@open-telemetry/specs-semconv-approvers since there are quite a few approvals by the k8s/container approvers can we move this one forward?

@ChrsMark
Copy link
Member Author

Thank's @joaopgrassi! My only concern is about #1128 (comment). Does this look normal?

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

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

Please fix anchor name and this PR should be good to go.

ChrsMark and others added 13 commits August 5, 2024 09:25
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Helen <56097766+heyams@users.noreply.github.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@lmolkova lmolkova merged commit f48852f into open-telemetry:main Aug 5, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

10 participants