Skip to content

Add container.cpu.usage metric#1128

Merged
lmolkova merged 13 commits intoopen-telemetry:mainfrom
ChrsMark:add_container_cpu_usage
Aug 5, 2024
Merged

Add container.cpu.usage metric#1128
lmolkova merged 13 commits intoopen-telemetry:mainfrom
ChrsMark:add_container_cpu_usage

Conversation

@ChrsMark
Copy link
Copy Markdown
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
Comment thread docs/system/container-metrics.md Outdated
Comment thread model/metrics/container.yaml
Comment thread model/metrics/container.yaml
Comment thread model/metrics/container.yaml
Comment thread model/metrics/container.yaml Outdated
Comment thread model/metrics/container.yaml Outdated
Comment thread docs/system/container-metrics.md Outdated
Comment thread model/metrics/container.yaml Outdated
Comment thread model/metrics/container.yaml Outdated
@ChrsMark ChrsMark force-pushed the add_container_cpu_usage branch 2 times, most recently from 15e0e08 to dab7f82 Compare June 26, 2024 11:22
@github-actions
Copy link
Copy Markdown

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
Comment thread model/metrics/container.yaml
@github-actions github-actions Bot removed the Stale label Jul 13, 2024
@ChrsMark
Copy link
Copy Markdown
Member Author

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

Comment thread model/metrics/container.yaml Outdated
@ChrsMark
Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Comment thread docs/system/container-metrics.md Outdated
Copy link
Copy Markdown
Member

@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 ChrsMark force-pushed the add_container_cpu_usage branch from 70dd573 to 9c12ac1 Compare August 5, 2024 06:26
@lmolkova lmolkova merged commit f48852f into open-telemetry:main Aug 5, 2024
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