otel_get_it 0.1.0-beta.1
otel_get_it: ^0.1.0-beta.1 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.1.0-beta.1 - 2026-05-13 #
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.- Zone-scoped suppression
(
runWithoutGetItInstrumentationand async variant). - 4 tests using
GetIt.asNewInstance()(no global state).