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

[receiver/hostmetrics] Fix calculation of process.cpu.utilization #19166

Conversation

antonblock
Copy link
Contributor

Description: Fixes the calculation of process CPU utilization. Rather than using a single ucal.CPUUtilizationCalculator struct to calculate the utilization over the collection interval, maintain one for each PID. After each scrape, remove any entries for PIDs that are no longer present.

Link to tracking Issue: #19119

Testing: Testing was performed manually by exporting to Prometheus, and comparing values to those reported by top on that system at the same time.

Documentation: No documentation was added, apart from the proposed CHANGELOG entry

@runforesight
Copy link

runforesight bot commented Mar 1, 2023

Foresight Summary

    
Major Impacts
Foresight hasn't detected any major impact on your workflows and tests.

View More Details

⭕  build-and-test-windows workflow has finished in 6 seconds (43 minutes 9 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
windows-unittest-matrix -     🔗  N/A See Details
windows-unittest -     🔗  N/A See Details

✅  check-links workflow has finished in 45 seconds (1 minute 50 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
changed files -     🔗  N/A See Details
check-links -     🔗  N/A See Details

✅  telemetrygen workflow has finished in 1 minute 7 seconds (2 minutes 6 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
build-dev -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details
publish-latest -     🔗  N/A See Details

✅  changelog workflow has finished in 1 minute 40 seconds (1 minute 6 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
changelog -     🔗  N/A See Details

✅  prometheus-compliance-tests workflow has finished in 3 minutes 24 seconds (5 minutes 49 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
prometheus-compliance-tests -     🔗  ✅ 21  ❌ 0  ⏭ 0    🔗 See Details

✅  load-tests workflow has finished in 7 minutes 13 seconds (10 minutes 31 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
loadtest (TestTraceAttributesProcessor) -     🔗  ✅ 3  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestIdleMode) -     🔗  ✅ 1  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestTraceNoBackend10kSPS|TestTrace1kSPSWithAttrs) -     🔗  ✅ 8  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestMetric10kDPS|TestMetricsFromFile) -     🔗  ✅ 6  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestMetricResourceProcessor|TestTrace10kSPS) -     🔗  ✅ 12  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestTraceBallast1kSPSWithAttrs|TestTraceBallast1kSPSAddAttrs) -     🔗  ✅ 10  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestBallastMemory|TestLog10kDPS) -     🔗  ✅ 18  ❌ 0  ⏭ 0    🔗 See Details
setup-environment -     🔗  N/A See Details

 build-and-test workflow has finished in 15 minutes 34 seconds (56 minutes 50 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
unittest-matrix (1.20, internal) N/A  ✅ 561  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, extension) N/A  ✅ 537  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, internal) N/A  ✅ 561  ❌ 0  ⏭ 0    🔗 See Details
correctness-metrics N/A  ✅ 2  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, processor) N/A  ✅ 1525  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, extension) N/A  ✅ 537  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, processor) N/A  ✅ 1525  ❌ 0  ⏭ 0    🔗 See Details
correctness-traces N/A  ✅ 17  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, receiver-0) N/A  ✅ 2580  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, receiver-0) N/A  ✅ 2580  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, exporter) N/A  ✅ 2456  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, exporter) N/A  ✅ 2456  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, receiver-1) N/A  ✅ 1937  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, other) N/A  ✅ 4788  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, other) N/A  ✅ 4788  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.20, receiver-1) N/A  ✅ 1937  ❌ 0  ⏭ 0    🔗 See Details
integration-tests N/A  ✅ 55  ❌ 0  ⏭ 0    🔗 See Details

✅  e2e-tests workflow has finished in 11 minutes 41 seconds (5 minutes 2 seconds less than main branch avg.) and finished at 1st Mar, 2023.


Job Failed Steps Tests
kubernetes-test (v1.26.0) -     🔗  N/A See Details
kubernetes-test (v1.25.3) -     🔗  N/A See Details
kubernetes-test (v1.24.7) -     🔗  N/A See Details
kubernetes-test (v1.23.13) -     🔗  N/A See Details

🔎 See details on Foresight

*You can configure Foresight comments in your organization settings page.

@antonblock antonblock force-pushed the fix/hostmetricsreceiver-processutilization branch from 6dd0685 to d832464 Compare March 1, 2023 16:14
@antonblock antonblock force-pushed the fix/hostmetricsreceiver-processutilization branch from d832464 to 59ab8c2 Compare March 1, 2023 16:41
@antonblock antonblock marked this pull request as ready for review March 1, 2023 17:50
@antonblock antonblock requested a review from a team March 1, 2023 17:50
@atoulme atoulme requested a review from andrzej-stencel March 1, 2023 17:51
Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmitryax dmitryax merged commit e61f8ba into open-telemetry:main Mar 2, 2023
@antonblock antonblock deleted the fix/hostmetricsreceiver-processutilization branch March 2, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants