otel_get_it 0.1.0-beta.1 copy "otel_get_it: ^0.1.0-beta.1" to clipboard
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 named get_it <operation> <type> with di.system=get_it, di.operation, di.type, and optionally di.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 (runWithoutGetItInstrumentation and async variant).
  • 4 tests using GetIt.asNewInstance() (no global state).
0
likes
130
points
88
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

OpenTelemetry instrumentation for `package:get_it`. Wraps async singleton registration and lookup with spans so DI bootstrap cost is visible in your traces.

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api, get_it

More

Packages that depend on otel_get_it