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

OpenTelemetry instrumentation for `package:isar`. Helpers to wrap Isar collection operations and transactions with `db.system.name=isar` semconv spans.

otel_isar #

OpenTelemetry instrumentation for package:isar.

final id = await tracedIsarCall<int>(
  operation: 'put',
  collection: 'users',
  invoke: () => isar.users.put(user),
);

final user = await tracedIsarCall<User?>(
  operation: 'get',
  collection: 'users',
  invoke: () => isar.users.get(id),
);

await tracedIsarWriteTxn(() async {
  await isar.users.put(user);
  await isar.orders.put(order);
});

Each call opens a CLIENT span:

  • name: isar <op> [<collection>]
  • db.system.name = isar
  • db.operation.name = <op>
  • db.collection.name = <collection> (when applicable)

Isar uses code-generated collection accessors and doesn't expose a per-query interceptor, so wrapping at the call site (or in your data-layer methods) is the most portable instrumentation point.

Suppression: runWithoutIsarInstrumentationAsync.

License #

Apache 2.0

0
likes
160
points
74
downloads

Documentation

API reference

Publisher

verified publisherdartastic.io

Weekly Downloads

OpenTelemetry instrumentation for `package:isar`. Helpers to wrap Isar collection operations and transactions with `db.system.name=isar` semconv spans.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api

More

Packages that depend on otel_isar