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 resource attribute for number of cores #977

Open
rockdaboot opened this issue Apr 29, 2024 · 5 comments
Open

Add resource attribute for number of cores #977

rockdaboot opened this issue Apr 29, 2024 · 5 comments
Assignees
Labels
area:host area:system enhancement New feature or request experts needed This issue or pull request is outside an area where general approvers feel they can approve

Comments

@rockdaboot
Copy link

rockdaboot commented Apr 29, 2024

Area(s)

area:host, area:system

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

The profiling agent that recently has been donated to OTEL by Elastic sends the number of present logical CPU cores as host metadata.

Currently, the field name is specific to Elastic and should be changed it to something fitting for OTEL semantic conventions.

Describe the solution you'd like

Add a new resource attribute like system.cpu.logical.count (or under host.cpu.*).

A more generic approach would be to reflect the CPU topology, similar to what Linux systems present (see https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu) or at least keep that in mind when deciding for a name.

Describe alternatives you've considered

Use a field name outside the OTEL semantic conventions (what is done currently). Not ideal regarding future compatibility (may theoretically cause conflicts).

Additional context

No response

@rockdaboot rockdaboot added enhancement New feature or request experts needed This issue or pull request is outside an area where general approvers feel they can approve triage:needs-triage labels Apr 29, 2024
@mx-psi
Copy link
Member

mx-psi commented Jul 18, 2024

We had a long discussion on #99 about whether this should be an attribute or a metric and we decided it would be a metric. You can see #99 (comment). I don't think we should represent the same concept as both a metric and a resource attribute.

@rockdaboot
Copy link
Author

@mx-psi Thank you for the pointer. I just left a comment (#99 (comment)). My use case would be profiling, where we use the number of logical CPUs as part of the CO2 and $ cost calculations.
Maybe we can leave this issue open for more opinions.

@trask
Copy link
Member

trask commented Jul 19, 2024

hey @rockdaboot, I'm not sure if cpu cores can be a resource attribute today since it is potentially mutable (open-telemetry/opentelemetry-specification#2384 (comment))

but I think this limitation is being worked on by the resources and entities SIG, see https://github.com/open-telemetry/community/blob/main/projects/resources-and-entities.md#problem-3-lack-of-mutable-attributes

@rockdaboot
Copy link
Author

Hey @trask, thanks for the links, just my point of view...

I'm not sure if cpu cores can be a resource attribute today since it is potentially mutable (open-telemetry/opentelemetry-specification#2384 (comment))

Well, isn't everything above the hardware level mutable during runtime!? For me, the question is where to draw the line, e.g. why are host.name, host.ip and similar attributes considered unmutable but the number of cores is considered mutable?

We are talking about the host/OS level here, not about single processes. Is seems not to be relevant whether the Java runtime is able to pick up changed CPU values or whether taskset or docker are able to limit CPU resources for single processes (as comments in #2384 suggest).

Let's see how the resources and entities SIG decides :)

@mx-psi
Copy link
Member

mx-psi commented Nov 14, 2024

We discussed this at KubeCon NA 2024 on 2024-11-14. Now that the resources and entities SIG is pushing the possibility of mutable attributes, this is unblocked and could be added. There is precedent about the same concept being represented as both a resource attribute and a metric (e.g. HTTP request body size) so we can add this if useful regardless of the existance of metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:host area:system enhancement New feature or request experts needed This issue or pull request is outside an area where general approvers feel they can approve
Development

No branches or pull requests

5 participants