otel_shared_preferences 0.1.0
otel_shared_preferences: ^0.1.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.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.