otel_logging 0.1.0-beta.1
otel_logging: ^0.1.0-beta.1 copied to clipboard
Bridge `package:logging` records into the OpenTelemetry logs SDK so trace_id / span_id correlation lights up automatically for any Dart app using the Dart team's standard logging package.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0-beta.1 - 2026-05-13 #
Added #
PackageLoggingBridge.install()/uninstall()— subscribes topackage:logging'sLogger.root.onRecordand emits OTel log records via the activeLoggerProvider. EachLogger(name)becomes its own OTel instrumentation scope; severity is mapped to OTelSeverityusing the same boundaries as the SDK's existingdart:developerbridge.error/stackTraceon a record becomeexception.type/exception.message/exception.stacktraceattributes.- Bridge holds a single
StreamSubscriptionand cancels it onuninstall(), so the isolate exits cleanly aftermain()(related to issue #33 in the SDK repo). - Trace-log correlation: the bridge re-enters the caller's
Zone(captured bypackage:loggingonLogRecord.zone) before callingLogger.emit, soContext.currentresolves to the user's active span instead of the install-zone's context. Without this, records emitted insidestartActiveSpanAsyncreached Loki without atrace_id/span_id, breaking the Grafana log→trace pivot. Pinned down bytest/integration/lgtm_loki_test.dart.