Embedded Datastores
<!-- status: beta language: embedded-datastores -->
Embedded and in-memory datastores (server SDKs)
Stores with no server (SQLite, LMDB, RocksDB, bbolt, ETS, caches) are monitored from inside the app. Every SDK uses one model, so the Datastores area treats them alike. Node is in node.md.
Model
Spans follow OTel db semconv:
db.system.name,db.operation.name,db.namespace(file path or logical name),db.collection.name(bucket, table, tree). Keys, values and raw SQL are never recorded. SQL spans carrydb.query.hashanddb.query.summary(also the span name).db.query.textis opt-in and sanitized. The hash algorithm is insql-normalization.md, and all SDKs run the shared vectors.Metrics are
wt.embedded.*, tagged{db.system.name, db.namespace}(the datastore entity, with the resource host/service). Counters are cumulative totals; the SDK exporters send deltas.Gauges:
file.size,wal.size,map.size,map.used,memory.used,cache.size(bytes),keys,compaction.pending(bytes),transactions.open,free_pages,levels.files,snapshots.open,iterators.open,readers.Counters:
cache.hits,cache.misses,cache.evictions,cache.rejections,lock.waits,lock.wait_time(ms),compactions,compaction.duration(ms),flushes,transactions,bytes.written,bytes.read.A store reports only what it knows. Names outside the list and negative values are dropped.
Coverage
SDK | Spans | Metrics |
|---|---|---|
Go |
| the same packages plus |
Python | sqlite3, aiosqlite, apsw, duckdb, lmdb, plyvel, rocksdict, tinydb | the same plus diskcache, cachetools, functools.lru_cache |
Rust (feature | rusqlite ( | sled, redb, heed, moka, RocksDB (property closure), files |
Java | upstream OTel JDBC (H2, HSQLDB, SQLite JDBC) | Caffeine, RocksDB JNI (property reader), files (H2, HSQLDB, MapDB) |
.NET | - | MemoryCache, files (Microsoft.Data.Sqlite, LiteDB, DuckDB) |
PHP | - | APCu, files (SQLite3, PDO sqlite) |
Elixir | Mnesia transactions | ETS, DETS, Mnesia tables and node stats, Cachex |
Ruby | sqlite3 ( | - |
Job frameworks: Celery (Python), Sidekiq (Ruby) and Oban (Elixir) already have SDK integrations over the upstream OTel instrumentations. River (Go) ships rivercontrib/otelriver upstream, so the SDKs add nothing there.