otel_shared_preferences 0.2.0
otel_shared_preferences: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:shared_preferences`. Extension methods on SharedPreferences that wrap write/remove/clear calls with key-value-store spans.
Changelog #
0.2.0 - 2026-10-11 #
Changed #
- Requires
dartastic_opentelemetry_api >=1.0.0-rc.4 <1.0.0-rc.5. - 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.1.0 - 2026-08-10 #
Added #
- Extension methods on
SharedPreferences:tracedSetString,tracedSetInt,tracedSetBool,tracedSetDouble,tracedSetStringList,tracedRemove,tracedClear. Each opens aCLIENTspan namedshared_prefs <op> <key>withstorage.system=shared_preferences,storage.operation,storage.key. - Reads (
getString,getInt, etc.) are intentionally NOT wrapped — they're synchronous and very fast, so the overhead isn't worth it for typical apps. File an issue if you need them. - Zone-scoped suppression helpers
(
runWithoutSharedPreferencesInstrumentationand the async variant) mirroring the rest of the OSS wrappers. - Tests use
SharedPreferences.setMockInitialValues; no real preferences backend needed.