Skip to content

opentelemetry-sdk: stabilize logs signal - #5732

Open
herin049 wants to merge 2 commits into
herin049/logs-api-stabilizationfrom
herin049/logs-sdk-stabilization
Open

herin049 wants to merge 2 commits into
herin049/logs-api-stabilizationfrom
herin049/logs-sdk-stabilization

Conversation

@herin049

@herin049 herin049 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part 2/3 of the logs stabilization stack (API -> SDK -> exporters). Depends on #5731.

Stabilizes the logs signal in the SDK package by moving it from opentelemetry.sdk._logs to the public opentelemetry.sdk.logs package and removes SDK logs features that were already deprecated.

  • Moves opentelemetry.sdk._logs to opentelemetry.sdk.logs. opentelemetry.sdk._logs stays as a deprecated alias that emits a DeprecationWarning and keeps the old submodule paths (export, _internal, …) working.
  • Removes the deprecated aliases LogExporter, LogExportResult, ConsoleLogExporter, InMemoryLogExporter, LogLimits and LogDroppedAttributesWarning.
  • Removes the deprecated SDK LoggingHandler, the OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED environment variable and the setup_logging_handler argument of _initialize_components.
  • Updates the entry points, the OTEL_PYTHON_LOGGER_CONFIGURATOR default, the docs (docs/sdk/logs*.rst) and all in-repo imports.

Fixes #3361

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Stack created with GitHub Stacks CLI • Give Feedback 💬

@herin049
herin049 requested a review from a team as a code owner October 3, 2026 02:51
@herin049
herin049 added this pull request to stack #5734 October 3, 2026 02:51
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-10-03 04:09 UTC

Investigate required status check failures.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@herin049 herin049 added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Oct 3, 2026
@herin049 herin049 mentioned this pull request Oct 3, 2026
6 of 10 tasks
@herin049
herin049 force-pushed the herin049/logs-sdk-stabilization branch from 0f71f87 to 6be91d7 Compare October 3, 2026 03:50
@herin049
herin049 requested a balanced review from Copilot October 3, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Public API stabilization and compatibility changes span the SDK, configuration, exporters, and documentation.

Review effort: Balanced
Findings: None

What changed in this PR

Stabilizes the SDK logs API under opentelemetry.sdk.logs, preserving deprecated import compatibility while removing obsolete experimental APIs.

Changes:

  • Adds the public logs package and deprecated _logs aliases.
  • Removes deprecated log aliases, SDK LoggingHandler, and its configuration option.
  • Updates exporters, tests, documentation, examples, and entry points.
File Description
tests/​opentelemetry-test-utils/​tests/​test_otlp_test_server.py Uses public logs imports.
tests/​opentelemetry-docker-tests/​tests/​otlpexporter/​test_otlp_logs_functional.py Uses public logs imports.
opentelemetry-sdk/​tests/​test_configurator.py Updates configuration tests for removed handler setup.
opentelemetry-sdk/​tests/​shared_internal/​test_batch_processor.py Uses public logs imports.
opentelemetry-sdk/​tests/​logs/​test_sdk_metrics.py Uses public logs imports.
opentelemetry-sdk/​tests/​logs/​test_multi_log_processor.py Replaces handler-based test emission.
opentelemetry-sdk/​tests/​logs/​test_logs.py Uses public logs imports.
opentelemetry-sdk/​tests/​logs/​test_logger_provider_cache.py Tests caching through SDK loggers.
opentelemetry-sdk/​tests/​logs/​test_log_record.py Uses public logs imports.
opentelemetry-sdk/​tests/​logs/​test_log_limits.py Uses public logs imports.
opentelemetry-sdk/​tests/​logs/​test_handler.py Removes deprecated handler tests.
opentelemetry-sdk/​tests/​logs/​test_export.py Removes handler-dependent exporter tests.
opentelemetry-sdk/​tests/​logs/​test_deprecated_logs_module.py Tests deprecated module compatibility.
opentelemetry-sdk/​tests/​logs/​scripts/​logger_provider_resource_after_fork.py Uses public logs imports.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​export/​__init__.py Exposes stable exporter API.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​_internal/​export/​in_memory_log_exporter.py Removes deprecated exporter alias.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​_internal/​export/​__init__.py Moves exporter internals and removes aliases.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​_internal/​_logger_metrics.py Moves logger metrics internals.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​_internal/​_exceptions.py Moves exception helpers.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​_internal/​__init__.py Moves SDK implementation and removes handler APIs.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​logs/​__init__.py Defines the stable public SDK package.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​environment_variables/​__init__.py Removes deprecated environment variable.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​_logs/​__init__.py Implements deprecated import aliases.
opentelemetry-sdk/​src/​opentelemetry/​sdk/​_configuration/​__init__.py Removes automatic logging-handler setup.
opentelemetry-sdk/​pyproject.toml Updates logs entry points.
opentelemetry-sdk/​benchmarks/​logs/​test_benchmark_logs.py Uses public logs imports.
opentelemetry-sdk/​benchmarks/​logs/​test_benchmark_logging_handler.py Removes deprecated handler benchmark.
opentelemetry-configuration/​tests/​test_logger_provider.py Uses public logs imports.
opentelemetry-configuration/​src/​opentelemetry/​configuration/​_logger_provider.py Uses public logs imports.
opentelemetry-api/​src/​opentelemetry/​logs/​_internal/​__init__.py Updates SDK reference documentation.
exporter/​opentelemetry-exporter-otlp-proto-http/​tests/​test_proto_log_exporter.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-proto-http/​src/​opentelemetry/​exporter/​otlp/​proto/​http/​_log_exporter/​__init__.py Uses stable SDK interfaces.
exporter/​opentelemetry-exporter-otlp-proto-grpc/​tests/​logs/​test_otlp_logs_exporter.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-proto-grpc/​src/​opentelemetry/​exporter/​otlp/​proto/​grpc/​exporter.py Uses stable SDK interfaces.
exporter/​opentelemetry-exporter-otlp-proto-grpc/​src/​opentelemetry/​exporter/​otlp/​proto/​grpc/​_log_exporter/​__init__.py Uses stable SDK interfaces.
exporter/​opentelemetry-exporter-otlp-proto-common/​tests/​test_log_encoder.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-proto-common/​tests/​test_bytes_resource.py Replaces deprecated exporter alias.
exporter/​opentelemetry-exporter-otlp-proto-common/​src/​opentelemetry/​exporter/​otlp/​proto/​common/​_internal/​_log_encoder/​__init__.py Uses stable SDK records.
exporter/​opentelemetry-exporter-otlp-json-http/​tests/​test_log_exporter.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-json-http/​src/​opentelemetry/​exporter/​otlp/​json/​http/​_log_exporter.py Uses stable SDK interfaces.
exporter/​opentelemetry-exporter-otlp-json-file/​tests/​test_log_exporter.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-json-file/​src/​opentelemetry/​exporter/​otlp/​json/​file/​_log_exporter.py Uses stable SDK interfaces.
exporter/​opentelemetry-exporter-otlp-json-common/​tests/​test_log_encoder.py Uses public logs imports.
exporter/​opentelemetry-exporter-otlp-json-common/​tests/​__init__.py Uses stable SDK records.
exporter/​opentelemetry-exporter-otlp-json-common/​src/​opentelemetry/​exporter/​otlp/​json/​common/​_internal/​_log_encoder/​__init__.py Uses stable SDK records.
docs/​sdk/​logs.rst Documents the public logs package.
docs/​sdk/​logs.export.rst Documents public exporter APIs.
docs/​sdk/​index.rst Links the stable logs documentation.
docs/​sdk/​configuration.rst Removes obsolete environment-variable guidance.
docs/​sdk/​_logs.export.rst Removes private exporter documentation.
docs/​examples/​multi-destination-exporting/​README.rst Uses the stable exporter name.
docs/​examples/​multi-destination-exporting/​multi_destination_logs.py Uses public logs imports.
docs/​examples/​metrics/​sdk-metrics/​sdk_metrics.py Uses public logs imports.
docs/​examples/​logs/​README.rst Removes experimental-status warning.
docs/​examples/​logs/​example.py Uses public logs imports.
docs/​conf.py Updates Sphinx class references.
.changelog/​5732.removed.1 Records deprecated alias removals.
.changelog/​5732.removed Records handler and variable removals.
.changelog/​5732.deprecated Records _logs deprecation.
.changelog/​5732.changed Records logs SDK stabilization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Stabilize Logs

2 participants