otel_go_router 0.3.1
otel_go_router: ^0.3.1 copied to clipboard
OpenTelemetry instrumentation for go_router by Dartastic.io. Adds standard OpenTelemetry observability to applications that use go_router.
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.3.1 - 2026-10-17 #
Changed #
- README: standard header naming the instrumented library, its supported platforms and project links; pubspec description to match.
0.3.0 - 2026-10-11 #
Changed #
- Requires
dartastic_opentelemetry_api >=1.0.0-rc.4 <1.0.0-rc.5. - Supports
go_router18 (>=17.0.0 <19.0.0). - Breaking: depends on
dartastic_opentelemetry_apionly, no longer on the SDK. The application chooses and initializes the OpenTelemetry SDK. Parameters and fields typed with SDK classes now use the API types (APITracer,APISpan,APILogger, ...); SDK instances are still accepted wherever an API type is expected.
0.2.0 - 2026-08-10 #
Changed #
GoRouterSemanticsnow declares everynavigation.*key it emits locally — the upstreamNavigationSemanticsenum is not part of any publisheddartastic_opentelemetry_apirelease, so the package depends only on published API surface while keeping the emitted keys byte-identical to the intended semconv.- README: documented wiring per go_router's route API — observers
must also be attached to each
ShellRoute/StatefulShellBranchnavigator (a root-only observer is blind to in-shell navigation), andStatefulShellRoutebranch switches fire noNavigatorObserverat all (emit from thegoBranchcall site, or useotel_auto_routefor tab-aware observation). - README made vendor-neutral (no backend product names).
- 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 #
OTelGoRouterObserver— aNavigatorObserverthat emits one short span per navigation transition (didPush/didPop/didReplace/didRemove). Carries the package-localGoRouterSemanticsattribute keys (navigation.action,navigation.route.path,navigation.previous_route_path) plus anavigation.is_initial_routeflag for cold-start detection. Thesenavigation.*keys are SIG-proposal candidates, not registry semconv — see the enum's docs.- Targets
go_router: ^17.0.0. Works with any router that drives a FlutterNavigator— the observer is the standardNavigatorObserverAPI. spanNameBuilderconstructor option for callers using non-go_router routers that need URL-pattern substitution (with go_router,Route.settings.nameis already the matched pattern, so the default builder produces low-cardinality span names for free).recordArgumentsflag (off by default) for capturingRoute.settings.arguments.toString();argumentAttributeMaxLengthfor clipping.- 6 widget tests with an in-memory exporter covering initial-route push, subsequent push + previous_route_path, pop, go(), custom span name builder, and the clipped-arguments path.
- Runnable Flutter example (
example/) driving route transitions against any local OTLP-compatible backend.