Skip to content

Modify sdkstats manager#47363

Open
rads-1996 wants to merge 6 commits into
Azure:mainfrom
rads-1996:modify-sdkstats-manager
Open

Modify sdkstats manager#47363
rads-1996 wants to merge 6 commits into
Azure:mainfrom
rads-1996:modify-sdkstats-manager

Conversation

@rads-1996
Copy link
Copy Markdown
Member

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.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings June 4, 2026 23:04
@github-actions github-actions Bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Jun 4, 2026
Copy link
Copy Markdown
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 extends the statsbeat system in azure-monitor-opentelemetry-exporter to allow SDKs/distros to register additional metric callbacks and have their observations included alongside the built-in statsbeat network metrics.

Changes:

  • Add a callback registry and an _iter_extra_observations helper to safely aggregate extra observations from registered callbacks.
  • Add StatsbeatManager.add_metric_callback for registering per-metric callbacks (idempotent per callback instance).
  • Update statsbeat network metric callbacks to append contributed observations, and add unit tests + changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_utils.py Adds callback registry + iterator helper for contributed observations.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_manager.py Adds StatsbeatManager.add_metric_callback API for registering callbacks.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/_statsbeat_metrics.py Appends extra observations to built-in network metrics callbacks.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/statsbeat/test_metrics.py Adds tests validating callback registration and observation aggregation behavior.
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Documents the new callback capability under Features Added.

@rads-1996 rads-1996 force-pushed the modify-sdkstats-manager branch from 3e30c4d to d128d6f Compare June 5, 2026 00:00
@rads-1996 rads-1996 force-pushed the modify-sdkstats-manager branch from d128d6f to 15b56f1 Compare June 5, 2026 15:09
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