open-telemetry / semantic-conventions

Defines standards for generating consistent, accessible telemetry across a variety of domains
Apache License 2.0
284 stars 175 forks source link

Add (linux).process.cgroup attribute #1357

Open rogercoll opened 3 months ago

rogercoll commented 3 months ago

Area(s)

area:system

Is your change request related to a problem? Please describe.

The hostmetrics receiver is currently reporting the process.cgroup attribute: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/processscraper/metadata.yaml#L49

This attribute is really helpful as it can be used to extract containerization information like the K8s pod UID and/or the container ID which the process is running on.

Describe the solution you'd like

Standardize the process.cgroup attribute.

Describe alternatives you've considered

As cgroups being a Linux only technology, would it make sense to add the attribute under the linux namespace (e.g linux.process.cgroup)?

Additional context

No response

braydonk commented 3 months ago

I'm in favour of this attribute being under the linux namespace.

trisch-me commented 2 months ago

Hey @rogercoll, don't you think process will be better option for it? I know it's specific to linux, but process is common for all OS. I think the important namespace here is process and not the linux

@mjwolf what do you think?

mjwolf commented 2 months ago

I think this would be better under process as well. There are already OS specific attributes in process; process.owner is Windows specific while process.user.id and process.group.id. #1329 will also add another one with gnu.build_id. So I don't see a problem with adding process.cgroup, and it seems like a more natural location to me.

rogercoll commented 2 months ago

don't you think process will be better option for it?

I don't have a strong opinion about it, given that we already have OS specific attributes without the OS namespace it might make sense to have a unified approach (without OS).

We discussed this naming issue during today's system SIG and we notice that some attributes contain the OS while others don't, I think we should agree on the structure and fix these nuances. https://github.com/open-telemetry/semantic-conventions/issues/1403