otel_logger 0.2.0
otel_logger: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:logger`. A `LogOutput` that mirrors every log event into the OTel logs pipeline, carrying `trace_id` and `span_id` from the active span.
Changelog #
0.2.0 - 2026-08-10 #
Changed #
- Semantic conventions updated to the current OTel registry: deprecated
attribute keys are no longer emitted (
db.system->db.system.name,db.operation->db.operation.name,rpc.system->rpc.system.name, withrpc.servicefolded into a fully-qualifiedrpc.method). - Dependency floors raised to
dartastic_opentelemetry ^1.1.0-beta.12anddartastic_opentelemetry_api ^1.0.0-rc.1. The previous floors declared compatibility with API versions that predate the semconv enums this package uses and could not actually resolve-and-compile. repositoryURL corrected to the canonicalDartasticorg casing so pub.dev repository verification succeeds.
Added #
OTelLogOutput extends LogOutput— drops into anyLogger(...)construction and mirrors every event into the OpenTelemetry logs pipeline. Carriestrace_id/span_idfromContext.currentso log lines inside aTracer.startActiveSpanblock are auto-correlated with the surrounding span.- Maps
logger.Level→ OTelSeverity: trace → TRACE, debug → DEBUG, info → INFO, warning → WARN, error → ERROR, fatal → FATAL. Deprecatedverbosealiases TRACE andwtfaliases FATAL. LogEvent.error/LogEvent.stackTracelift to OTelexception.type/exception.message/exception.stacktraceattributes.includeStackTrace: falseopts out of the trace.runWithoutLoggerInstrumentation/ async variant — zone-scoped suppression matching the rest of the OSS wrappers.- 5 tests covering severity mapping, exception attribute attachment, opt-out, and suppression.