otel_drift 0.3.0 copy "otel_drift: ^0.3.0" to clipboard
otel_drift: ^0.3.0 copied to clipboard

OpenTelemetry instrumentation for package:drift. A drift QueryInterceptor emitting db.system.name=sqlite CLIENT spans per statement, plus traced call-site helpers.

Changelog #

0.3.0 - 2026-10-11 #

Changed #

  • Requires dartastic_opentelemetry_api >=1.0.0-rc.4 <1.0.0-rc.5.
  • Breaking: depends on dartastic_opentelemetry_api only, 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-09 #

Changed #

  • Semantic conventions updated to the current OTel registry: deprecated attribute keys are no longer emitted (db.system -> db.system.name, db.operation -> db.operation.name). The non-registry db.drift marker attribute was dropped; the instrumentation scope name (otel_drift) already identifies the source.
  • Dependency floors raised to dartastic_opentelemetry ^1.1.0-beta.12 and dartastic_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.
  • drift floor raised to ^2.14.0, the release that introduced the QueryInterceptor API.
  • repository URL corrected to the canonical Dartastic org casing so pub.dev repository verification succeeds.

Added #

  • OTelDriftInterceptor — a drift QueryInterceptor that opens a CLIENT span around every statement drift executes (select / insert / update / delete / custom / batch, plus transaction commit and rollback), with db.system.name=sqlite, db.operation.name, db.operation.batch.size on batches, and opt-in db.query.text (captureQueryText: true; off by default because statements can embed sensitive literals). Apply with executor.interceptWith(OTelDriftInterceptor()).
  • tracedDriftQuery<R>({operation, table, sql, invoke}) — call-site helper that opens a CLIENT span labelled with the intent (operation + table, db.collection.name) around a DAO call.
  • tracedDriftTransaction<R>(body) — convenience for tracedDriftQuery(operation: 'transaction', invoke: body).
  • Zone-scoped suppression (runWithoutDriftInstrumentation / async variant), honored by both the interceptor and the helpers.
  • Tests: interceptor asserted through drift's real interceptWith wiring against a fake QueryExecutor (delegation, attributes, batch size, commit, error status, suppression) plus the helper suite. An example/ was added.
0
likes
160
points
109
downloads

Documentation

API reference

Publisher

verified publisherdartastic.io

Weekly Downloads

OpenTelemetry instrumentation for package:drift. A drift QueryInterceptor emitting db.system.name=sqlite CLIENT spans per statement, plus traced call-site helpers.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry_api, drift

More

Packages that depend on otel_drift