otel_shared_preferences 0.1.0 copy "otel_shared_preferences: ^0.1.0" to clipboard
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 a CLIENT span named shared_prefs <op> <key> with storage.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 (runWithoutSharedPreferencesInstrumentation and the async variant) mirroring the rest of the OSS wrappers.
  • Tests use SharedPreferences.setMockInitialValues; no real preferences backend needed.
0
likes
160
points
66
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

OpenTelemetry instrumentation for `package:shared_preferences`. Extension methods on SharedPreferences that wrap write/remove/clear calls with key-value-store spans.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api, flutter, shared_preferences

More

Packages that depend on otel_shared_preferences