Skip to content

Use constants to decide distro version#46666

Open
rads-1996 wants to merge 2 commits intoAzure:mainfrom
rads-1996:fix-sdk-version
Open

Use constants to decide distro version#46666
rads-1996 wants to merge 2 commits intoAzure:mainfrom
rads-1996:fix-sdk-version

Conversation

@rads-1996
Copy link
Copy Markdown
Member

@rads-1996 rads-1996 commented May 1, 2026

Description

Pass the azure monitor distro version the exporter to set the telemetry sdk version, which is then passed on application insights.

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 May 1, 2026 15:18
@github-actions github-actions Bot added the Monitor - Distro Monitor OpenTelemetry Distro label May 1, 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 aims to propagate the Azure Monitor distro version via configuration so downstream components (notably the exporter / telemetry pipeline) can identify the distro version consistently.

Changes:

  • Adds a distro-version env var write during _get_configurations().
  • Re-exports a new constant from the exporter constants module to avoid duplicating the env var name.
  • Adds a unit test asserting the env var is set during configuration.

Reviewed changes

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

File Description
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_constants.py Imports/re-exports exporter constants intended to standardize distro version keys.
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/configurations.py Sets the distro version env var when building configurations.
sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_configurations.py Adds coverage to validate the env var gets set.

for key, val in kwargs.items():
configurations[key] = val
configurations[DISTRO_VERSION_ARG] = VERSION
environ[_AZURE_MONITOR_DISTRO_VERSION] = VERSION
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

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

Setting the distro version into os.environ here overwrites any existing value each time _get_configurations() is called. If the intent is just to provide a default for downstream components, consider using environ.setdefault(...) (similar to _default_resource) so user/host-provided values aren’t clobbered.

Suggested change
environ[_AZURE_MONITOR_DISTRO_VERSION] = VERSION
environ.setdefault(_AZURE_MONITOR_DISTRO_VERSION, VERSION)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants