BenoStreamDB Monitoring & Operations¶
BenoStreamDB is designed to be highly observable and easy to operate in serverless, ephemeral environments as well as traditional long-running daemon setups.
Observability by deployment mode¶
The engine records metrics in one place (the core registry) and every host exposes them, so a scrape sees the engine’s ingest/query/compaction/index metrics regardless of how the engine is deployed.
Deployment mode |
Metrics endpoint |
Health |
|---|---|---|
Embedded library (Python / Rust) |
|
|
Flight SQL server ( |
|
|
Search gateway ( |
|
|
Gateway / Iceberg REST bins |
|
|
Spark / Trino connectors |
|
host-provided |
The search gateway’s /metrics serves both its own bsdb_search_* registry
and the core engine’s bsdb_* metrics, so one scrape covers the whole
process.
Metrics configuration¶
Variable |
Description |
Default |
|---|---|---|
|
Bind address for the embedded/Flight metrics HTTP listener. |
|
|
Port for the embedded/Flight metrics HTTP listener. |
|
The listener defaults to localhost. Set
BSDB_METRICS_BIND=0.0.0.0only when a scraper runs on another host, and front it with auth/TLS.⚠️ Security: none of these endpoints authenticate. Run every BenoStreamDB server on a trusted internal network, behind a gateway/reverse proxy that terminates TLS and enforces authentication. Do not expose them to the public internet. See SECURITY.md.
Metric catalog¶
Engine metrics (bsdb_*)¶
Recorded with the prometheus crate in src/telemetry/metrics.rs:
Metric |
Type |
Labels |
Meaning |
|---|---|---|---|
|
counter |
— |
Rows ingested. |
|
histogram |
— |
Query latency. |
|
histogram |
— |
Vector/keyword search latency. |
|
histogram |
— |
Manifest commit duration. |
|
histogram |
— |
Compaction duration. |
|
histogram |
— |
HNSW-IVF build duration. |
|
gauge |
— |
Active Parquet files. |
|
gauge |
— |
Active segments. |
|
counter |
|
Cache hit/miss by cache. |
|
counter |
— |
Object-store I/O bytes. |
|
counter |
— |
OCC commit conflicts. |
|
gauge |
— |
Process RSS during ingest. |
|
counter |
— |
Ingest pauses on the RAM high-water mark. |
|
histogram |
— |
Duration of each pause. |
|
histogram |
— |
Wait for an index-build permit. |
|
gauge |
— |
Free disk for local tables. |
|
histogram |
|
Merge-on-read delete phases. |
|
counter |
|
Merged-deletes cache hit/miss. |
|
counter |
|
Parsed-delete cache hit/miss. |
|
counter |
|
Delete files merged by kind. |
|
counter |
— |
|
|
histogram |
|
Parquet read phases. |
|
counter |
|
Parquet-metadata cache hit/miss. |
Recorded with the metrics facade (query planner, compaction, manifest commit):
Metric |
Type |
Meaning |
|---|---|---|
|
counter |
Commits that skipped removals. |
|
counter |
OCC commit retries. |
|
counter |
OCC commit rebases. |
|
histogram |
Query planning duration. |
|
histogram |
Segment pruning duration. |
|
histogram |
Per-segment search duration. |
|
counter |
Segments pruned by vector bounding box. |
|
counter |
Data files compacted. |
|
counter |
Bytes written by compaction. |
Search gateway metrics (bsdb_search_*)¶
Metric |
Type |
Labels |
Meaning |
|---|---|---|---|
|
gauge |
— |
In-flight HTTP requests. |
|
counter |
|
Requests by route class. |
|
histogram |
|
Request latency. |
|
histogram |
|
Search latency by op ( |
|
counter |
|
Documents indexed. |
|
counter |
|
Bulk items by outcome. |
|
histogram |
— |
|
|
counter |
— |
Index table-cache hit/miss. |
|
counter |
|
Index bytes fetched from object storage. |
Telemetry & Tracing¶
BenoStreamDB leverages a push-based OpenTelemetry (OTLP) pipeline to export distributed traces. Because it often runs in serverless functions (like AWS Lambda) where instances may be frozen between invocations, the Table API explicitly flushes traces on teardown (via the Drop trait) to ensure no data is lost.
Configuration¶
Tracing is disabled by default. To enable tracing, set the JAEGER_ENABLED environment variable. When enabled, traces are automatically pushed to an OTLP-compatible endpoint.
Environment Variable |
Description |
Default |
|---|---|---|
|
Set to |
|
|
The destination URL for OTLP traces. |
|
|
The log level filter (e.g., |
|
Core Instrumentation¶
We instrument key paths to provide visibility into latency and bottlenecks:
Write Path:
write_async,commit_asyncRead Path:
read_async,stream_all,vector_search_index,vector_search_flatManifest Orchestration: Optimistic concurrency loops, schema updates, and conflict resolution in the
ManifestManager.
Stateless Operational CLI (bsdb)¶
The bsdb binary is a standalone CLI tool that performs administrative actions directly against the object storage tier without requiring a long-running database server to be active.
Usage¶
# Start an interactive SQL REPL
bsdb repl
# Execute a single SQL query
bsdb query --query "SELECT * FROM my_table LIMIT 10"
# Register a table in the session
bsdb register --name my_table --uri s3://my-bucket/my-table
Table Management¶
You can perform routine maintenance using the bsdb table subcommand:
# Inspect table metadata and statistics
bsdb table inspect --uri s3://my-bucket/my-table
# Compact small data files to optimize read performance
bsdb table compact --uri s3://my-bucket/my-table
# Vacuum (delete) data files that are no longer referenced and older than N days
bsdb table vacuum --uri s3://my-bucket/my-table --older-than-days 7
Note: The CLI is stateless; it interacts directly with the storage URI.