Skip to content

Remove deprecated events package and methods#45684

Open
rads-1996 wants to merge 4 commits intoAzure:mainfrom
rads-1996:fix-deprecation-warnings
Open

Remove deprecated events package and methods#45684
rads-1996 wants to merge 4 commits intoAzure:mainfrom
rads-1996:fix-deprecation-warnings

Conversation

@rads-1996
Copy link
Member

@rads-1996 rads-1996 commented Mar 13, 2026

Description

Fixes - (#45617). Events package libraries and methods are now deprecated. Using LoggerProvider and set_logger_provider instead.

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 March 13, 2026 14:39
@rads-1996 rads-1996 marked this pull request as draft March 13, 2026 14:39
@github-actions github-actions bot added the Monitor - Distro Monitor OpenTelemetry Distro label Mar 13, 2026
Copy link
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

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.

@rads-1996 rads-1996 force-pushed the fix-deprecation-warnings branch from 86a6398 to bc26e85 Compare March 13, 2026 15:02
@rads-1996 rads-1996 marked this pull request as ready for review March 13, 2026 15:42
Copy link
Member

@JacksonWeber JacksonWeber left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants