Skip to main content

bonito-store

The persistence layer of Bonito (BON-002). Stores exactly what Prometheus can't: query texts, execution plans, lock events, session snapshots and table stats in a single SQLite file. Receives JSON events from bonito-collector via POST /events.

Quickstart

uv pip install -e bonito-store
bonito-store serve --db bonito.db   # FastAPI on :8000
curl -X POST localhost:8000/events -H 'Content-Type: application/json' \
     -d @examples/events.sample.json
curl localhost:8000/baselines     # 7-day mean + p95 per fingerprint
bonito-store prune                # apply retention

Config

Variable Default Description
BONITO_DB bonito.db SQLite file path
BONITO_STORE_PORT 8000 HTTP port
BONITO_RETENTION_DAYS 7 Retention window (pruned in background)

Endpoints

  • POST /events — ingest a collector snapshot (batch capped at 100 per type)
  • POST /plans — ingest execution plan records (stored as JSON)
  • GET /baselines?fingerprint=...&days=7 — rolling mean + p95 per query
  • GET /health

Design

  • Dedupe: query_texts is keyed by fingerprint (sha256 of the minified query). Same query updates stats instead of creating a new row.
  • Baselines: each observation is appended to query_samples; baselines are computed on the fly over the last N days (mean + p95).
  • Retention: lock_events, session_snapshots, execution_plans, query_samples and table_stats are pruned past BONITO_RETENTION_DAYS. Identity tables (query_texts) keep the latest stats forever.
  • Plans: stored as raw JSON (EXPLAIN output) — never interpolated into prompts without truncation (LLM token governance).

Metadata

Release files for bonito-store 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bonito-store 0.1.1
File Size Uploaded Provenance
bonito_store-0.1.1.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bonito-store 0.1.1
File Interpreter ABI Platform
bonito_store-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / bonito_store-0.1.1.tar.gz

Download URL bonito_store-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1dd3e0acea71dbc3d4962f39e8e0fea4ef6a25c4a7d050a515b1270f231b076a
BLAKE2b-256 checksum
How to use checksums
f30606e7cae4d68e3d2a228e9e36d6bb01476daa163fd7155de8d89042b10806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / bonito_store-0.1.1-py3-none-any.whl

Download URL bonito_store-0.1.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
183cbed7a90f6b8dc55851eebef186edc4745c1967aa8fd8ce8f0b786385d255
BLAKE2b-256 checksum
How to use checksums
7fadedcd14a8e685383b353228a59cc4ddf3fdd554c68438c7bb296678677bba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for bonito-store 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page