Skip to content

Fix mypy errors for exporter and distro#45132

Open
rads-1996 wants to merge 5 commits intoAzure:mainfrom
rads-1996:fix-mypy-errors
Open

Fix mypy errors for exporter and distro#45132
rads-1996 wants to merge 5 commits intoAzure:mainfrom
rads-1996:fix-mypy-errors

Conversation

@rads-1996
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 11, 2026 15:21
@github-actions github-actions bot added Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter labels Feb 11, 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

This PR updates the Azure Monitor OpenTelemetry logging integration to address mypy issues by aligning with newer OpenTelemetry log types/exporter interfaces and adjusting internal processors and tests accordingly.

Changes:

  • Switch log record typing from ReadableLogRecord to ReadWriteLogRecord across processors, managers, samples, and tests.
  • Update log exporter typing from LogExporter to LogRecordExporter and rename local variables accordingly.
  • Add/adjust typing suppressions and small defensive checks to satisfy mypy.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sdk/monitor/azure-monitor-opentelemetry/samples/logging/modify_logs.py Updates sample processor signature to ReadWriteLogRecord and adds a mypy suppression for attribute/index access.
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py Renames local log exporter variable to match log-record terminology used by the processor.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/performance_counters/test_processor.py Updates test mocks to use ReadWriteLogRecord.
sdk/monitor/azure-monitor-opentelemetry-exporter/tests/performance_counters/test_performance_counters.py Updates test mocks to use ReadWriteLogRecord.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_processor.py Updates processor typing to ReadWriteLogRecord and exporter type to LogRecordExporter.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/logs/_exporter.py Tweaks typing/docstrings and adds guards/type suppressions for mypy compatibility.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_quickpulse/_processor.py Updates processor signature to ReadWriteLogRecord and propagates the new type.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_quickpulse/_manager.py Updates log record typing and adds suppressions on metric instrument creation calls.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_performance_counters/_processor.py Updates processor signature to ReadWriteLogRecord and propagates the new type.
sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_performance_counters/_manager.py Updates manager log-record typing from readable to read/write log records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants