Change8

v1.39.0

Breaking Changes
📦 opentelemetry
4 breaking2 features🐛 1 fixes1 deprecations🔧 4 symbols

Summary

This 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.

⚠️ 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

  1. For Log Exporters, change the signature to accept Sequence[ReadableLogRecord] instead of Sequence[LogData].
  2. For Log Processors, update on_emit to accept ReadWriteLogRecord and convert to ReadableLogRecord before exporting.
  3. Update imports and references for classes renamed from Log to LogRecord.
  4. Update attribute access on log records to use log_record.log_record, log_record.resource, log_record.instrumentation_scope, and log_record.limits.

✨ New Features

  • Objects of any type other than AnyValue in attributes within opentelemetry-api are now converted to string to ensure they are exportable.
  • Added opentelemetry-exporter-credential-provider-gcp as an optional dependency to opentelemetry-exporter-otlp-proto-grpc and opentelemetry-exporter-otlp-proto-http.

🐛 Bug Fixes

  • Fixed type checking for built-in metric exporters.

🔧 Affected Symbols

LogDataReadableLogRecordReadWriteLogRecordLogRecord

⚡ Deprecations

  • The Events API/SDK is deprecated. Events should now be implemented as LogRecords where the event_name field is set, using the Logs API/SDK instead.