Skip to main content

🐟 Bonito OSS

Deep database observability — a free DBmarlin. Captures slow queries, locks, wait events, and table stats from PostgreSQL (MySQL/Oracle/SQL Server planned), and exposes them to AI agents via MCP.

Status: v0.1.0 (Phase 0 — PostgreSQL MVP complete) · Apache 2.0


Why

Prometheus exporters give you Level 1 metrics (connections, txn/s, replication lag) — the numbers, not the why. Commercial tools like DBmarlin ($45/db/mo) give Level 3: query text, execution plans, lock/blocking trees, wait events. No open-source tool covers this well — and none exposes it to AI agents over MCP.

Bonito connects read-only to your database, reads the system views the engine already exposes for free (pg_stat_statements, pg_stat_activity, pg_locks, pg_stat_user_tables), and emits deep observability data.

Architecture

 ┌──────────────┐  system views   ┌───────────────┐  POST /events  ┌───────────────┐
 │  PostgreSQL  │──────────────▶  │ bonito-collector│──────────────▶ │ bonito-store  │
 │  (read-only) │  Prometheus      │ (PyPI)  :9187  │  JSON (≤100)   │ SQLite+baseline│
 └──────────────┘  :9187/metrics   └───────────────┘                 └──────┬────────┘
                                                                           │ reads
                                                              ┌────────────▼────────┐
                                                              │ bonito-api (FastAPI) │  X-API-Key
                                                              │ :8100 · openapi.yaml │  private deploy
                                                              └────────────┬────────┘  public contract
                                                                           │ REST
                                                              ┌────────────▼────────┐
                                                              │ bonito-mcp (MCP)     │  stdio / SSE :8840
                                                              │ 8 tools for agents   │
                                                              └────────────┬────────┘
                                                                           ▼
                                                   Claude · Bedrock · Strands · Remo (R-007)

Quick start (5 min)

docker compose -f deploy/docker-compose.yml up -d
# PostgreSQL fixture + collector + store + api + mcp

curl -H "X-API-Key: change-me" localhost:8100/queries/top?limit=5
curl -H "X-API-Key: change-me" localhost:8100/baseline/-6842865755026457642

claude mcp add bonito -- bonito-mcp        # connect an AI agent

Full step-by-step: docs/quickstart.md.

Components

Component What PyPI
bonito-collector Read-only PostgreSQL collector bonito-collector
bonito-store SQLite event store + 7-day baselines bonito-store
bonito-api FastAPI query layer (private deploy, public contract) bonito-api
bonito-mcp MCP server — 8 tools for AI agents bonito-mcp-server

API reference

Endpoint Description
GET /queries/top?db_instance=&period=&limit= Top queries by mean execution time
GET /locks/active?db_instance=&minutes= Recent lock events / blocking pairs
GET /waits?db_instance=&minutes= Wait breakdown by wait_event_type
GET /plans/{fingerprint} Latest execution plan (JSON)
GET /health/{db_instance} Sessions by state + top table bloat
GET /baseline/{fingerprint}?days= 7-day baseline + regression_pct
POST /ingest Compat webhook (same payload as store /events)

Full reference: docs/api.md · MCP tools: docs/mcp.md.

Docs & Examples (v0.1.0)

Security (golden rule)

  • Connection is READ-ONLY (a DB user with only SELECT on stat views)
  • Never build SQL from client input — only fixed queries over system views
  • Never writes to the client database
  • API is private by default (BONITO_API_KEY required); only the OpenAPI contract is public

License

Apache 2.0 · LICENSE · CONTRIBUTING.md


Built by Carlos Cortez — AWS Community Hero. Part of the SOFE / Remo / Bonito observability ecosystem.

Metadata

Release files for bonito-collector 0.1.3

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-collector 0.1.3
File Size Uploaded Provenance
bonito_collector-0.1.3.tar.gz 16.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bonito-collector 0.1.3
File Interpreter ABI Platform
bonito_collector-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / bonito_collector-0.1.3.tar.gz

Download URL bonito_collector-0.1.3.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
02912e1c84c0ecb4a9ace8f1da86242fc53f7a9f152d83195836df09e55aea9b
BLAKE2b-256 checksum
How to use checksums
7e2c304fbb9d6259440ecd847d7f96b7e319c8d6fdcdf2d5445326f3b60c8b41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / bonito_collector-0.1.3-py3-none-any.whl

Download URL bonito_collector-0.1.3-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53c70e3d2215d13e2a6e524dcd1940943bb8ce7bcce06eaccbf6ef9f0631c5f5
BLAKE2b-256 checksum
How to use checksums
833c720c6c5789c416c285a8e28f5d15667dc2697a02260311b295c0bf609024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Security for bonito-collector 0.1.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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