otel_hive 0.2.0
otel_hive: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:hive`. Box extension methods that wrap put/putAll/delete/clear/compact in `db.system.name=hive` semconv CLIENT spans.
otel_hive #
OpenTelemetry instrumentation for
package:hive.
final box = await Hive.openBox<dynamic>('users');
await box.tracedPut('alice', {'name': 'Alice'});
await box.tracedDelete('bob');
await box.tracedPutAll({'k1': 'v1', 'k2': 'v2'});
await box.tracedClear();
Each call emits a CLIENT span:
- name:
hive put users/alice db.system.name = hivedb.collection.name = users,db.operation.name = putdb.hive.key = alice(omitted on operations without a key)db.operation.batch.sizeontracedPutAll
Synchronous reads (get, values, length, containsKey) are
not wrapped — wrapping every sync read would generate a flood
of spans for minimal observability value.
Using hive_ce? The Box extension targets package:hive, but the
generic tracedHiveCall helper wraps any call site.
Suppression: runWithoutHiveInstrumentationAsync.
License #
Apache 2.0