-
Notifications
You must be signed in to change notification settings - Fork 183
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 metric fields (from ECS) #282
Conversation
b7d690a
to
451f3b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a prototype/implementation of these metrics somewhere (e.g. in collector contrib?)
The Collector implementation can be found at https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/dockerstatsreceiver/documentation.md but the naming is more or less different. The respective Beats implementation that honors the ECS fields can be found as an example at https://github.com/elastic/beats/blob/89bcc33a9a90cbacceaa61fceec0e8d23073574c/metricbeat/module/docker/cpu/data.go#L65. I will come with a comparison matrix soon to help us understand what are our alternatives/options here. |
So I have checked what ECS provides in combination with the Otel Collector's implementation. Here is summary:
So based on the above I propose the following naming:
|
451f3b2
to
113808a
Compare
19c8c0e
to
2b73f9d
Compare
Pushed latest changes based on #282 (comment). |
2b73f9d
to
775a7d1
Compare
Will need to use the network and disk attributes from #530 |
775a7d1
to
f44061c
Compare
@rmfitzpatrick @jamesmoessis since you have been maintaining the dockerstatsreceiver could you provide your feedback here? @open-telemetry/semconv-container-approvers please have a look as well. |
Why don't we start with
I see it's implemented in the docker receiver for metrics like Also, |
Thank's @dmitryax Ilike the idea of being aligned with kubeletstats as well.
Also do you propose to skip the |
Right. But I'm not sure about
All these metrics correspond 1:1 to the info that the docker provides. We cannot get more granular data to provide metrics with state and logical number attributes as we do for The kubelet, on the other hand, doesn't provide any data other than plain container time/usage values. So we don't have any attributes for the I'm curious how https://www.elastic.co/guide/en/ecs/current/ecs-container.html#field-container-cpu-usage is used in the existing implementations. Is it used to represent the docker stats? Maybe we can just define Another option is to change the docker receiver to emit |
Yes @dmitryax, this metric is used to represent the total CPU usage calculated from docker stats.
The implementation can be found at https://github.com/elastic/beats/blob/13ec0b30f5502720ff5079853e6f437478348ec7/metricbeat/module/docker/cpu/data.go#L32-L61 A sample document can be found at https://github.com/elastic/beats/blob/main/metricbeat/module/docker/cpu/_meta/data.json. From these the So I think that all implementations can emit this base metric called |
I agree with what @dmitryax is saying. We can change the dockerstats receiver to emit In terms of the I think for CPU
I propose to skip this for now. Reduce the scope of this PR and it will be closed out faster. This PR should have bare minimum then we can add more in later PRs. |
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>
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>
068af39
to
9f1a8f0
Compare
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
2875b5f
to
b5aa89a
Compare
@joaopgrassi @lmolkova thank's for reviewing! I have tried to address or answer your comments. Could have another look please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments, but LGTM.
Heads up on #820 - we want to merge it (hopefully very soon) and once it's in stability will be required for all metrics, attributes, and enum members.
I have filed #840 to keep track of #282 (comment). Beyond this, I believe that's ready to go now @open-telemetry/specs-semconv-maintainers :) |
This PR adds container related metrics fields as part of #72.
Continues #87 on top of the project restructuring.
Based on the comparison between ECS and Otel collector the result is the following (see #282 (comment)).
Summary of added fields
container.cpu.time
(ok for the Collector implementation: Add container metric fields (from ECS) #282 (comment))container.memory.usage
(more accurate and aligned with system metrics)container.disk.io
which has as dimension the already existentdisk.io.direction
(Otel collector only provides the Linux specific metric and hence a generic one capable to cover Windows as well would be better)container.network.io
which has as dimension the already existentnetwork.io.direction
(better alignment with disko.io and use of dimension).All of those also refer to
container.id
as attribute as well.