Initialize OneSettings for Microsoft distro - #243
Closed
Leighton Chen (lzchen) wants to merge 7 commits into
Closed
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
Performance comparisonThreshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR initializes the shared OneSettings configuration manager from use_microsoft_opentelemetry() so the Microsoft distro identity (component="mot" and distro VERSION) is registered early (before Azure Monitor exporter setup), and updates the Azure Monitor exporter dependency accordingly.
Changes:
- Initialize OneSettings configuration manager at the start of
use_microsoft_opentelemetry(). - Update
azure-monitor-opentelemetry-exporterdependency to~=1.0.0b56(and lockfile). - Add orchestration tests and an unreleased changelog entry; ignore
.vscode/workspace files.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/microsoft/opentelemetry/_distro.py |
Adds config manager initialization ahead of exporter setup. |
tests/test_distro.py |
Adds tests verifying initialization ordering and disable behavior. |
pyproject.toml |
Bumps Azure Monitor exporter requirement to ~=1.0.0b56. |
uv.lock |
Updates locked Azure Monitor exporter version and metadata. |
CHANGELOG.md |
Adds unreleased entry for the OneSettings initialization behavior. |
.gitignore |
Ignores .vscode/ directory. |
Suppressed comments (1)
src/microsoft/opentelemetry/_distro.py:106
_initialize_configuration_manager()currently assumesget_configuration_manager()is always available and thatinitialize()cannot fail. Since this is a best-effort control-plane contribution, it’s safer to (1) no-op whenget_configuration_manageris unavailable (e.g., import guarded) and (2) catch unexpected exceptions so a OneSettings failure doesn’t prevent the distro from configuring OpenTelemetry.
"""Contribute the Microsoft distro identity to the shared OneSettings profile."""
config_manager = get_configuration_manager()
if config_manager:
# Profile fields are first-wins, so initialize before exporters add their fields.
config_manager.initialize(component="mot", version=VERSION)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07de762e-7d54-46cb-9d78-ab8ea1c82cbe
This reverts commit bafe402.
Contributor
Author
|
Closing in favor of #244 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
use_microsoft_opentelemetry()with the Microsoft distro profilecomponent="mot"and the distro version win first-write profile matching1.0.0b56Testing
python -m pytest tests\test_distro.py tests\azure_monitor\test_configure.py --quiet(104 passed in the OTM virtual environment)