v1.39.0
Breaking Changes📦 opentelemetry-pythonView on GitHub →
⚠ 4 breaking✨ 2 features🐛 1 fixes⚡ 1 deprecations🔧 4 symbols
Summary
This release introduces major breaking changes to the Logs API/SDK by removing LogData and renaming several Log classes to LogRecord, while also deprecating the Events API in favor of enhanced LogRecord usage.
⚠️ Breaking Changes
- LogData has been removed. Log Exporters must now accept Sequence[ReadableLogRecord] instead of Sequence[LogData].
- Log Processors should now use ReadWriteLogRecord for processing and convert to ReadableLogRecord before exporting.
- Several classes previously named Log have been renamed to LogRecord. Users must update imports and references accordingly.
- LogData attributes are now accessed differently on the new record types: use log_record.log_record for the API LogRecord, log_record.resource for Resource, log_record.instrumentation_scope for InstrumentationScope, and log_record.limits for LogRecordLimits.
Migration Steps
- For Log Exporters, change the signature to accept Sequence[ReadableLogRecord] instead of Sequence[LogData].
- For Log Processors, update on_emit to accept ReadWriteLogRecord and convert to ReadableLogRecord before exporting.
- Update imports to use ReadableLogRecord and ReadWriteLogRecord instead of LogData.
- Update references to renamed classes from Log to LogRecord.
- Adjust attribute access on log records to use log_record.log_record, log_record.resource, log_record.instrumentation_scope, and log_record.limits.
✨ New Features
- Added opentelemetry-exporter-credential-provider-gcp as an optional dependency to opentelemetry-exporter-otlp-proto-grpc and opentelemetry-exporter-otlp-proto-http.
- Objects of any type other than AnyValue in attributes are now converted to string in opentelemetry-api to ensure they are exportable.
🐛 Bug Fixes
- Fixed type checking for built-in metric exporters.
Affected Symbols
⚡ Deprecations
- The Events API/SDK is deprecated. Events should now be modeled as LogRecords where the event_name field is set, utilizing the Logs API/SDK instead.