Skip to content

Comments

Fix io_counters import issue#45286

Merged
rads-1996 merged 12 commits intoAzure:mainfrom
rads-1996:fix-io-counters-import-issue
Feb 24, 2026
Merged

Fix io_counters import issue#45286
rads-1996 merged 12 commits intoAzure:mainfrom
rads-1996:fix-io-counters-import-issue

Conversation

@rads-1996
Copy link
Member

Description

Fixes - #45283

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Copilot AI review requested due to automatic review settings February 20, 2026 22:31
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Feb 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses startup/import failures in azure-monitor-opentelemetry-exporter performance counters caused by psutil.Process().io_counters() raising (e.g., AccessDenied) during module import, and adds a regression test to validate the fallback behavior.

Changes:

  • Guard module-level initialization of I/O counters to avoid import-time failures when psutil I/O counters are unavailable or inaccessible.
  • Add a unit test that re-executes the module under a patched psutil.Process to simulate AccessDenied at import time.
  • Document the fix in the package CHANGELOG.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_performance_counters/_manager.py Adds exception handling around initial I/O counters read to prevent import-time crashes.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/performance_counters/test_performance_counters.py Adds regression test using runpy + patched psutil.Process to validate import-time fallback.
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Adds a Bugs Fixed entry for the import issue.

@rads-1996 rads-1996 force-pushed the fix-io-counters-import-issue branch 2 times, most recently from cbd9265 to 9edbcef Compare February 23, 2026 16:16
@rads-1996 rads-1996 force-pushed the fix-io-counters-import-issue branch from 4721c6e to 44d3c3c Compare February 23, 2026 21:41
@rads-1996 rads-1996 requested a review from hectorhdzg February 23, 2026 21:42
@rads-1996 rads-1996 force-pushed the fix-io-counters-import-issue branch from 4b1347c to 7348828 Compare February 23, 2026 23:07
@rads-1996 rads-1996 merged commit de31ec7 into Azure:main Feb 24, 2026
20 checks passed
@rads-1996 rads-1996 deleted the fix-io-counters-import-issue branch February 24, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants