otel_get_it 0.2.0
otel_get_it: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:get_it`. Wraps async singleton registration and lookup with spans so DI bootstrap cost is visible in your traces.
Changelog #
0.2.0 - 2026-08-10 #
Changed #
get_itconstraint widened to>=8.0.0 <10.0.0— supports get_it 9.x (verified against 9.2.1) while keeping 8.x compatibility.- 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 #
- Extension methods on
GetIt:tracedRegisterSingletonAsync,tracedAllReady,tracedGetAsync,tracedUnregister,tracedReset. Each opens a CLIENT span namedget_it <operation> <type>withdi.system=get_it,di.operation,di.type, and optionallydi.instance_name. - Synchronous
get<T>()is intentionally NOT wrapped — those calls are sub-microsecond and span overhead would dominate. The async path (registerSingletonAsync,allReady,getAsync) is where instrumentation pays off — it captures DI bootstrap cost at startup. tracedGetItCall<R>({operation, typeName, instanceName, invoke})— generic helper for testability and custom call sites.- Local
GetItSemanticsenum (implementsOTelSemantic) for thedi.system/di.operation/di.type/di.instance_namekeys — replaces raw-string keys per the OTel-Dart wrapper style guide. - Zone-scoped suppression
(
runWithoutGetItInstrumentationand async variant). - Ten tests on the SDK's test surface
(
package:dartastic_opentelemetry/testing.dart; instance-scoped viaGetIt.asNewInstance(); no global state, no network). Coverage: every traced method's success path, the error path onregisterSingletonAsync,instanceNamepropagation, both suppression entry points, and multi-registration spans. example/example.mdshowing a full app-boot trace.