OpenTelemetry
Backend & InfraOpenTelemetry Python API and SDK
Release History
v1.39.11 fixThis is a patch release fixing an issue related to silencing events API warnings for internal users.
v1.39.0Breaking1 fix2 featuresThis release introduces significant breaking changes to the logging SDK by removing LogData and renaming several Log classes to LogRecord, while also deprecating the Events API in favor of enhanced LogRecord functionality. It also improves attribute serialization and dependency management.
v1.38.01 featureThis release extends the functionality of Logger.emit and introduces pre-commit checks for RST validity. It also adds deprecation warnings for upcoming class renames.
v1.37.03 fixes3 featuresThis release introduces experimental composite samplers and new environment variables for configuring OTLP exporter credentials during auto-instrumentation. It also includes several bug fixes related to log handling and attribute limits.
v1.36.02 fixes1 featureThis release improves logging stability by ensuring the OTLP LogHandler persists after configuration calls and refines exporter shutdown behavior to be more time-bound. It also adds documentation for the Prometheus exporter.
v1.35.0Breaking6 fixes2 featuresThis release stabilizes the Log signal by introducing `event_name` for events and deprecating direct trace context fields in favor of a context object for log initialization. It also includes several fixes and updates to exporters and SDK components.
v1.34.11 fix1 featureThis patch release addresses an issue with mypy type ignoring in opentelemetry-sdk and restores the missing span_exporter property on BatchSpanProcessor.
v1.34.0Breaking1 fix2 featuresThis release drops support for Python 3.8, updates type checking mechanisms, and includes refactoring in log and span processors along with a fix for a shutdown recursion error.
v1.33.11 fixThis patch release fixes a critical issue where log messages in BatchLogRecordProcessor caused a crash during shutdown.
v1.33.0Breaking3 fixesThis release stabilizes code attribute names in the SDK, fixes several bugs related to HTTP connections and log serialization, and updates semantic conventions.
v1.32.11 fixThis is a patch release addressing issues found in the previous 1.32.0/0.53b0 version.
v1.32.05 fixesThis release focuses on bug fixes, including correcting the OTLP HTTP metrics exporter user agent and patching logging behavior, alongside performance improvements for baggage operations.
v1.31.11 fixThis patch release reverts a change regarding `BaseException` recording in `trace_api.use_span()` to fix an issue from the previous 1.31.0/0.52b0 release.
v1.31.05 fixes4 featuresThis release includes several bug fixes across OTLP encoding, Prometheus exporter labeling, and resource detector loading, alongside new type annotations and improved exception handling in span recording.
v1.30.0Breaking3 fixes3 featuresThis release introduces support for Python 3.13, updates semantic conventions to 1.30.0, and fixes serialization issues for None values in logs. A breaking change involves the removal of a misplaced network attribute constant.
Common Errors
ConnectionRefusedError2 reportsConnectionRefusedError in OpenTelemetry usually indicates that the target endpoint (e.g., collector or exporter) is unavailable or not listening on the specified host and port. Resolve this by ensuring the OpenTelemetry collector/exporter is running and accessible on the network, and that the OTLP exporter configuration (host, port) in your application matches the collector's listening address. Verify no firewalls are blocking the connection between your application and the collector.
MaxRetryError2 reportsMaxRetryError in OpenTelemetry usually indicates the exporter failed to connect to the backend (e.g., OTLP collector) after repeated attempts. Resolve this by verifying the backend address is correct and reachable from your application (check network connectivity, firewall rules, and DNS resolution). Also, ensure the backend is running and accepting connections.
NewConnectionError2 reportsNewConnectionError in OpenTelemetry usually indicates a failure to establish a network connection to the configured backend (e.g., OTLP collector). Verify that the backend service is running and accessible from where your application is deployed, paying specific attention to the host, port, and any necessary firewall rules. Additionally, double-check your OpenTelemetry exporter configuration for correctness, ensuring the endpoint URL aligns with your backend's actual address.
ConnectTimeoutError1 reportConnectTimeoutError in OpenTelemetry SDKs usually indicates the exporter failed to establish a connection with the backend within the configured timeout. Increase the `OTEL_EXPORTER_OTLP_TIMEOUT` environment variable or the equivalent SDK configuration to allow more time for the connection, and verify network connectivity between the exporter and the OTLP collector or endpoint. If the backend is overloaded, consider scaling it or implementing retry mechanisms in the exporter.
TelemetryOptionalImportError1 reportThe "TelemetryOptionalImportError" usually arises when an optional dependency required by a specific feature (like an exporter or propagator) is missing. To fix this, identify the missing dependency from the error message and install it using pip; for example, `pip install grpcio` if the error mentions gRPC. Ensure your OpenTelemetry packages themselves are up-to-date too via `pip install --upgrade opentelemetry-sdk opentelemetry-exporter-otlp`.
ConnectionResetError1 reportConnectionResetError in OpenTelemetry often arises due to network instability or timeouts during data transmission to the exporter. Implement retry logic within the OpenTelemetry exporter configuration, increasing the 'timeout' setting and adding exponential backoff to handle transient network issues; also, ensure your network infrastructure correctly allows long-lived connections. Setting keepalive configurations on both the client and server sides may further help prevent idle connection drops.
Related Backend & Infra Packages
Production-Grade Container Scheduling and Management
Node.js JavaScript runtime ✨🐢🚀✨
Promise based HTTP client for the browser and node.js
A modern runtime for JavaScript and TypeScript.
Deliver web apps with confidence 🚀
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Subscribe to Updates
Get notified when new versions are released