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

Divided proc_cpu_percent by 100 to get value between 0 and 1 #2812

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

mrugeshmaster
Copy link
Contributor

@mrugeshmaster mrugeshmaster commented Aug 21, 2024

Description

process.runtime.cpu.utilization should record value between 0 and 1 as per OTEL spec.

psutil reports percentage value for cpu utilization. This MR converts CPU utilization from percentage to decimal between 0.0 and 1.0.

Fixes #2810

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • instrumentation/opentelemetry-instrumentation-system-metrics/tests/test_system_metrics.py::TestSystemMetrics::test_runtime_cpu_percent PASSED

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@mrugeshmaster mrugeshmaster requested a review from a team August 21, 2024 22:02
@lzchen lzchen merged commit 1ad9d90 into open-telemetry:main Aug 21, 2024
521 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

process.runtime.cpu.utilization values are between 0 and 100, should be 0 and 1
2 participants