Remove deprecated events package and methods#45684
Open
rads-1996 wants to merge 4 commits intoAzure:mainfrom
Open
Remove deprecated events package and methods#45684rads-1996 wants to merge 4 commits intoAzure:mainfrom
rads-1996 wants to merge 4 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the package’s (now-deprecated) OpenTelemetry “events” integration from the Azure Monitor OpenTelemetry distro’s logging setup, updating tests and release notes accordingly.
Changes:
- Delete the optional Events provider configuration from
_setup_logging. - Update unit tests to stop patching/asserting against the removed events modules.
- Add a CHANGELOG entry noting removal of deprecated events packages.
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/azure/monitor/opentelemetry/_configure.py | Removes the Events setup block from _setup_logging; leaves logging setup otherwise unchanged. |
| sdk/monitor/azure-monitor-opentelemetry/tests/test_configure.py | Removes Events-related mocks/patches/assertions from logging setup tests. |
| sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md | Notes the removal of deprecated events packages under “Other Changes”. |
Comments suppressed due to low confidence (1)
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py:275
- The ImportError handler comment still refers to “events” (e.g., “If the events is not available…”) even though the events setup block was removed. Please update the comment to refer to logging (and adjust the wording so it matches the actual failure being caught).
except ImportError as ex:
# If the events is not available, we will not set it up.
# This could possibly be due to breaking change in upstream OpenTelemetry
# Advise user to upgrade to latest OpenTelemetry version
_logger.warning( # pylint: disable=do-not-log-exceptions-if-not-debug
"Exception occurred when setting up Logging. Please upgrade to the latest OpenTelemetry version: %s.",
ex,
You can also share your feedback on Copilot code review. Take the survey.
86a6398 to
bc26e85
Compare
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.
Description
Fixes - (#45617). Events package libraries and methods are now deprecated. Using
LoggerProviderandset_logger_providerinstead.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines