Collect metrics from DBs so your knows what to optimize

Your agent can suggest improvements, but it can’t see what happened yesterday. DBMetrics collects query and workload history and makes it available to your agent.

Collect to self-hosted
How it works
You ask Claude

“Why is my database slow?”

  1. Agent gets metrics from DBMetrics

    Via MCP, the agent sees latency jumped after a migration 2 days ago.

  2. Agent finds and fixes the cause

    A new query needs an index. Claude adds it with your approval.

  3. Agent verifies the fix with DBMetrics

    Fresh metrics confirm the same query is faster.

    Before the fix248 ms
    After the fix91 ms

How DBMetrics works

Collect metrics from different databases at once. Your agent reads the history through DBMetrics to investigate slowdowns, optimize queries and verify improvements.

Your infrastructure

Multiple databases, connected together

PostgreSQLExtension
MySQL
Collector
MongoDB
Collector

No inbound database access

DBMetrics

Database metrics, stored over time

Run on your server or in the cloud

DockerUbuntuCloud
APICLIMCP

Your AI agent

Claude Code, Codex or OpenCode

  • “Are my databases running well?”
  • “Optimize my indexes.”
  • “It started slowing down 2 days ago. Why?”

Install DBMetrics

Run the server, connect your database, then give your agent access. Follow the commands or copy a prompt and let your agent help.

Setup preview: packages and endpoints below are illustrative.

01

Run the metrics server

Store your metrics on infrastructure you control.

Install with

Run it yourself

TERMINAL

Ask your agent

02

Connect PostgreSQL

Send database metrics to your DBMetrics server.

Run it yourself

Use a dedicated monitoring user.

SQL + TERMINAL

Ask your agent

03

Connect your agent

Give your agent access to the metrics history through MCP.

Ready to investigate

Your agent can read the history from every connected database.

  • Find when queries got slower
  • Suggest indexes using real workload data
  • Check performance after a change

Ask your agent

Prefer a managed metrics server?

You run the collector. DBMetrics Cloud handles storage and updates. Cloud signup is coming soon.

Pricing per database

Run DBMetrics for free on your infrastructure or pay for managed storage in the cloud. Connect your existing agent with either option.

Self-hosted

Open source

Your server. You manage storage and updates.

$0software cost
any number of databases

Install DBMetrics
  • Unlimited connected databases
  • Keep history as long as your storage allows
  • Metrics stay on your infrastructure
  • MCP, API and CLI access
  • Connect any supported agent

You cover your own infrastructure costs.

Cloud

Coming soon

You run the collector. We host the metrics server.

$19per database
per month · USD

  • 30 days of metrics history
  • Managed storage and server updates
  • Mix supported database types in one account
  • MCP, API and CLI access
  • Connect any supported agent
Monthly total$57 / month

What counts as a database? One monitored database connection. A replica counts separately if you connect it for monitoring.

Same price for every database type. Your agent subscription is paid separately.

Questions before you connect

Can’t my agent just connect to the database?

Yes. Direct access can show its current state. DBMetrics continuously records query and workload history so your agent can also investigate what happened yesterday, during a traffic spike or before a release.

Does DBMetrics change my database?

DBMetrics collects observations and makes them available to your agent. It doesn’t apply indexes or change configuration. You review recommendations and use your existing workflow to make and verify changes.

What data does the collector gather?

Query frequency and timings, schema and indexes and available workload metrics such as connections and locks. The exact set depends on the database and how it’s deployed. Query text can contain sensitive data; review collection settings before connecting production.

Does it work with managed databases?

The collector can run near a database and connect with a monitoring user. Managed providers differ in the statistics and extensions they expose, so the available metrics depend on your provider and permissions.

Do I need another AI subscription?

Use your existing Claude Code, Codex or OpenCode setup. DBMetrics supplies the metrics through MCP. Your agent subscription and model usage stay with your existing provider.

Can I use it with SQLite?

SQLite runs inside your application. Collect query timings with an application-side integration and send them to DBMetrics. An external collector can inspect the database file but cannot reconstruct timings for queries your app already ran.

DBMetrics Cloud

Run a collector near your database. We host the metrics server, store the history and handle updates. Your agent accesses the metrics through MCP.

Cloud is $19 per database per month with 30 days of history. For 3 databases, that’s $57/month.

Cloud signup is coming soon. You can explore the self-hosted setup preview now.

Explore installation