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.0

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.0
File Size Uploaded Provenance
bonito_store-0.1.0.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 17.4 kB

Release files / bonito_store-0.1.0.tar.gz

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

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

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

Security for bonito-store 0.1.0

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