otel_redux 0.2.0 copy "otel_redux: ^0.2.0" to clipboard
otel_redux: ^0.2.0 copied to clipboard

OpenTelemetry instrumentation for `package:redux`. Provides a Middleware that emits a span per dispatched action.

otel_redux #

OpenTelemetry instrumentation for package:redux. Plug a middleware into your store and every dispatch shows up in your trace.

import 'package:redux/redux.dart';
import 'package:otel_redux/otel_redux.dart';

final store = Store<AppState>(
  appReducer,
  initialState: AppState.initial(),
  middleware: [otelReduxMiddleware<AppState>()],
);

store.dispatch(AddToCartAction(item: item));
// → span: `redux AddToCartAction`

Each dispatch opens an INTERNAL span with:

  • name: redux <action runtime type>
  • state.system = redux
  • state.operation = dispatch
  • state.action.name = <runtime type>

Spans inherit the surrounding active span as parent, so a dispatch inside a Tracer.startActiveSpan('user_flow', ...) nests naturally.

Suppression: runWithoutReduxInstrumentation and async variant.

License #

Apache 2.0

0
likes
160
points
74
downloads

Documentation

API reference

Publisher

verified publisherdartastic.io

Weekly Downloads

OpenTelemetry instrumentation for `package:redux`. Provides a Middleware that emits a span per dispatched action.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api, redux

More

Packages that depend on otel_redux