Skip to content

Revert adding azure monitor distro in sdkVersion#46963

Open
rads-1996 wants to merge 4 commits into
Azure:mainfrom
rads-1996:revert-dst-changes
Open

Revert adding azure monitor distro in sdkVersion#46963
rads-1996 wants to merge 4 commits into
Azure:mainfrom
rads-1996:revert-dst-changes

Conversation

@rads-1996
Copy link
Copy Markdown
Member

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

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

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 18, 2026 20:59
@github-actions github-actions Bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label May 18, 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 reverts use of the Azure Monitor distro environment variable when composing the exporter SDK version, so SDK version reporting falls back to exporter version unless Microsoft OpenTelemetry is explicitly detected.

Changes:

  • Removed AZURE_MONITOR_DISTRO_VERSION handling from exporter SDK version generation.
  • Updated related SDK version tests.
  • Added a changelog entry for the bug fix.

Reviewed changes

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

File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_utils.py Removes distro env var lookup from _get_sdk_version().
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py Removes the unused distro SDK-version environment variable constant.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py Updates SDK version unit tests for the reverted behavior.
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Documents the SDK version behavior fix.
Comments suppressed due to low confidence (3)

sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py:831

  • This updated test no longer sets AZURE_MONITOR_DISTRO_VERSION, so it only verifies the default path instead of the regression this PR is intended to cover. Keep the distro environment variable present and assert that _get_sdk_version() still returns the exporter version; otherwise the old dst... behavior could be reintroduced without this test failing.
    @patch.dict(
        "azure.monitor.opentelemetry.exporter._utils.environ",
        clear=True,
    )
    def test_get_sdk_version_distro(self, mock_python_version, mock_prefix):
        result = _utils._get_sdk_version()
        self.assertEqual(result, "uum_py3.11.0:otel1.20.0:ext{}".format(_utils.ext_version))

sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py:831

  • This assertion hard-codes the package's current _version.VERSION without patching azure.monitor.opentelemetry.exporter._utils.ext_version, unlike the default-version test above. The next version bump will make this unrelated test fail unless it is updated, so it should either patch ext_version or compare against the imported value.
        self.assertEqual(result, "uum_py3.11.0:otel1.20.0:ext{}".format(_utils.ext_version))

sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_utils.py:829

  • The test name still says distro, but the patched environment is now empty and the assertion covers the default exporter path. This makes the test suite misleading; rename it or restore the distro-env setup so the name matches the behavior under test.
    def test_get_sdk_version_distro(self, mock_python_version, mock_prefix):

@rads-1996 rads-1996 force-pushed the revert-dst-changes branch from 0028f83 to ef4959c Compare May 18, 2026 21:07
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