Skip to content

Database monitoring

Database health from the host installer, managed databases by URL, slow queries from spans.

In the console: Console → Observe → Applications (APM) → your application → Database

All guides

The Database page joins two views: what your application asks the database (queries, latency and errors from spans) and what the database reports about itself (connections, cache hit rate, sizes, locks, replication) read every minute on the host.

No password is asked for or sent. A database in a container is entered with docker exec and its own local login, and only statistics views are read — never table rows.

Why use it

  • You need to know whether slowness is a bad query or a saturated database.
  • You run databases on your own hosts or as managed services and want one view of their health.

How it works

  1. 1A sampler on the host (installed with APM) finds databases by container image or listening port every minute.
  2. 2It reads each engine’s own statistics views with its local login — never table rows, never a password sent to AppStatus.
  3. 3Managed databases are read by URL from databases.conf.
  4. 4Snapshots join the APM queries to the same database by address on the application’s Database page.

What you get

  • PostgreSQL (with pg_stat_statements and, on 16+, generic plans of the slowest statements), MySQL/MariaDB, Redis/Valkey/KeyDB, MongoDB, ClickHouse, Elasticsearch/OpenSearch, Memcached, Cassandra/ScyllaDB and SQL Server.
  • Any other database container (InfluxDB, Neo4j, CouchDB, CockroachDB, etcd …) listed with its engine, version and resources.
  • Each container’s CPU, memory, disk and IOPS.
  • Slow queries with literals masked, and an AI tuning suggestion.

Set it up

Get Started shows these commands with your key already filled in — copying from there is the quickest path. Here, <your-key> marks where it goes.

  1. 1

    Installed with APM

    The eBPF installer (apm.sh) adds the database sampler as a timer. With the OpenTelemetry Collector method, Get Started adds the same samplers with one extra line:

    terminal
    curl -sSL 'https://agent.appstatus.io/apm.sh?key=<your-key>&env=production&project=shop&only=helpers' | sudo sh
  2. 2

    Managed databases (RDS, Cloud SQL, Atlas …)

    Add one connection URL per line to /etc/appstatus/databases.conf on a host that can reach them. Use a read-only monitoring user.

    /etc/appstatus/databases.conf
    postgres://monitor:secret@mydb.abc123.eu-west-1.rds.amazonaws.com:5432/postgres
    mysql://monitor:secret@mysql.internal:3306/
    redis://:secret@cache.internal:6379

Check it works

  1. 1

    See what would be sent

    terminal
    sudo APPSTATUS_DRY_RUN=1 appstatus-dbstats

Uninstall / remove

  1. 1

    Removed with the eBPF agent

    terminal
    curl -sSL "https://agent.appstatus.io/apm.sh?uninstall=1" | sudo sh
  2. 2

    Managed databases only

    Delete the line from /etc/appstatus/databases.conf and drop the monitoring user.

Troubleshooting

The problems seen most, each with what to run. Still stuck? See the general Troubleshooting guide.

My database is not on the page

It is found by container image or by listening port. Run the dry run; if it is missing there, check that the container name or port is standard, or add it to databases.conf by URL.

PostgreSQL shows no statements

Install pg_stat_statements: add it to shared_preload_libraries, restart PostgreSQL, then CREATE EXTENSION pg_stat_statements; in the database.

A managed database is unreachable

The host running the sampler must reach it over the network (security group, firewall, VPC peering) and the user must be allowed to read statistics views.

Something here does not match what you see in the console? Open Help → Support in AppStatus or write to support@appstatus.io with the page and what you ran.