Quick verdict
If your question is "which request is slow and where does its time go", start with APM: a trace shows the request, the service calls and the database spans inside it. If your question is "why is this query or this server slow", you need database monitoring: waits, blocking, plans and statistics for all workloads on the server, including jobs and users that no APM agent sees. Most production teams that depend on a database need both, ideally linked so that a slow span leads to the query's server-side detail.
Database monitoring collects data from the database engine itself. Engines publish it through their own views: SQL Server's dynamic management views and Query Store, PostgreSQL's cumulative statistics views and pg_stat_statements, MySQL's Performance Schema. A database monitoring tool samples these on a schedule, keeps history and adds dashboards and alerts. Examples include Redgate Monitor, SolarWinds SQL Sentry and Database Performance Analyzer, Datadog Database Monitoring, and open source stacks built on Prometheus exporters.
APM (application performance monitoring) instruments the application. An agent or an OpenTelemetry SDK records each request as a trace made of spans: the incoming HTTP request, calls to other services, cache lookups and database queries. Each database span carries the duration seen by the application and attributes such as the database system and, where safe, the query text. Examples include Datadog APM, New Relic APM and open source tracing backends that accept OpenTelemetry data.
Both are part of what vendors call observability, and several platforms sell both. The difference is the vantage point: one looks out from the database at all its clients, the other looks out from one application at everything it calls.
Side by side
| Aspect | Database monitoring | APM |
|---|---|---|
| Vantage point | Inside the database server | Inside the application |
| Main data | Wait statistics, locks and blocking, query statistics, execution plans, server resources | Request traces and spans, latency, throughput, errors, service dependencies |
| Unit of analysis | Normalised query, session, wait type, database | Request or transaction, service, endpoint |
| Sees | Every client of the database: applications, jobs, reports, people | Only instrumented applications |
| Query timing | Server-side execution time, CPU, reads, waits | Client-side duration, including network and driver time |
| Answers | Why is this query or server slow? What is it waiting on? | Which request is slow, and which step inside it? |
| Usual users | DBAs, database and platform engineers | Application developers and SREs |
| Main trade-off | Deep on the database, blind to the user request that caused the load | Shows the user impact, but a database span only says the call was slow, not why |
Key differences
What database monitoring sees: waits and query statistics
Database engines record why work is waiting. SQL Server's sys.dm_os_wait_stats returns aggregated information about all waits encountered by threads, cumulative since the last restart or reset; PostgreSQL's pg_stat_activity shows each backend's state and its current wait_event_type (such as Lock, LWLock, IO or Client) and wait_event. Query statistics come from Query Store and sys.dm_exec_query_stats on SQL Server, pg_stat_statements on PostgreSQL, and Performance Schema digests on MySQL. A monitoring tool samples these regularly so you can compare today with last week. Two baseline queries the tools build on:
-- SQL Server (T-SQL): top waits since the last restart or clear
SELECT TOP (10) wait_type, waiting_tasks_count,
wait_time_ms, signal_wait_time_ms
FROM sys.dm_os_wait_stats
ORDER BY wait_time_ms DESC;
-- PostgreSQL: what active sessions are waiting on right now
SELECT pid, state, wait_event_type, wait_event, left(query, 60) AS query
FROM pg_stat_activity
WHERE wait_event IS NOT NULL AND state = 'active';Microsoft notes that sys.dm_os_wait_stats needs VIEW SERVER PERFORMANCE STATE on SQL Server 2022 and later. In practice raw totals include many benign background waits, which tools filter out. Because this data comes from the server, it covers every workload: an overnight ETL job, a report someone runs from a desktop client, a deadlock between two services (see error 1205). None of that is visible to an APM agent in a single application.
What APM sees: requests, traces and spans
APM measures from the caller's side. The OpenTelemetry semantic conventions for database client spans, now marked stable, specify a CLIENT span whose duration should cover the whole call as the caller saw it, with attributes such as db.system.name, db.namespace, db.operation.name, a low-cardinality db.query.summary and, subject to sanitisation, db.query.text. The conventions say non-parameterised query text should not be collected by default unless sensitive literals are removed.
This view shows things the database cannot: that one page load runs the same query 200 times in a loop (the N+1 pattern), that most of a request's time is spent in an external API rather than the database, or that latency comes from connection pool waits in the application. New Relic's documentation, for example, describes slow query data sampled from transaction traces on its Databases page, with explain plans where supported. What APM cannot show is why the server took the time: whether the query waited on a lock held by another process, read from disk, or changed plan.
Where they overlap: query timing
Both report how long a query took, but the numbers differ. The database measures execution on the server; the application span also includes network round trips, driver work, fetching rows and, depending on instrumentation, time waiting for a pooled connection. A span of 900 ms for a query the server ran in 40 ms points away from the database; a span that matches the server time points into it. Neither number is wrong; they measure different intervals.
Some products now join the two. Datadog, for example, documents a DBM and APM connection that injects trace identifiers into queries as SQL comments, so a query sample in database monitoring links to the trace that issued it, and a trace span links to the query's explain plan; it supports Postgres, MySQL, SQL Server, Oracle and MongoDB. Without such a link, teams correlate by time, host and normalised query text.
Why teams combine them
A typical incident crosses both. APM raises an alert that checkout latency has doubled and shows the time is in one database span. Database monitoring shows that query is now waiting on locks held by a batch job that APM never saw, or that its plan changed after a statistics update. Each tool alone would leave half the story: APM would blame "the database", database monitoring would show a busy server without saying which users were affected.
In our view the order of investment depends on who owns the problem. Teams that write the application but use a managed database often start with APM and add database monitoring when database spans dominate. Teams that run shared databases for many applications start with database monitoring, because most load on the server is outside any one application's traces. See performance tuning for working with the plans both lead to.
Pricing and licensing
This is a conceptual comparison, so there is no single price; the billing units differ. Database monitoring products are commonly priced per monitored database instance or per database host: Datadog lists Database Monitoring per database host per month, separate from its APM and infrastructure products. APM is commonly priced per application host or by data volume: New Relic, for example, bills by data ingested per GB plus user licences across its platform. Built-in database views and open source stacks have no licence cost but need hosting and staff time. See the individual comparisons, such as Datadog vs New Relic and Prometheus vs Datadog, for dated prices.
Pricing checked on the vendors' official pages on 7 October 2026. Prices change; confirm before buying.
Where each one leads
Database monitoring strengths
- Explains why a query is slow: waits, locks, plans, I/O
- Sees every client of the database, not just instrumented applications
- Keeps history of query statistics to spot regressions and plan changes
- Covers server health: capacity, replication, jobs, blocking and deadlocks
APM strengths
- Shows the user-facing impact: which requests and endpoints are slow
- Breaks a request down across services, caches, external calls and the database
- Finds application patterns the database cannot, such as N+1 queries and pool waits
- Vendor-neutral instrumentation available through OpenTelemetry
Limitations
Database monitoring limitations
- Cannot tell which user request or service caused the load without correlation
- Server-side time misses network, driver and connection pool delays
- Usually needs elevated monitoring permissions on the server
APM limitations
- A database span shows that a call was slow, not why
- Blind to workloads from uninstrumented jobs, reports and people
- Query text may be dropped or sanitised for privacy, limiting detail
When to choose each
Choose Database monitoring if
- You run databases shared by many applications, jobs and users
- You need to diagnose blocking, deadlocks, waits or plan regressions
- You are responsible for database capacity and health rather than one application
- The application is a third-party product you cannot instrument
Choose APM if
- You own an application and need to know which requests are slow and why
- Time is spread across several services, caches and external APIs
- You use a managed database and have little control over the server
- You suspect application patterns such as N+1 queries
When neither is right
- You only need occasional PostgreSQL query analysis: the built-in
pg_stat_statementsview and a log analyser may be enough; see pgAdmin vs pgBadger. - You run a single SQL Server and want a dedicated DBA tool rather than an observability platform: see Redgate Monitor vs SQL Sentry and Datadog vs Redgate Monitor.
- You want infrastructure metrics and alerting on a budget: see Prometheus vs Datadog.
Final recommendation
Database monitoring and APM are two halves of one picture. APM tells you which requests are slow and how much of their time is the database; database monitoring tells you why the database took that time and what else was running. If you can afford only one, choose by ownership: application teams usually start with APM, teams running shared databases with database monitoring. Where both are in use, link them, through trace-to-query correlation where your tools support it, so that a slow span leads straight to the query's waits and plan.
Frequently asked questions
Is database monitoring part of APM?
Not usually. APM records database calls as spans from the application's side, which shows timing but not the server's waits, locks or plans. Database monitoring is a separate product category, although some observability vendors sell both and link them.
Why does APM show a slower query time than the database?
Because they measure different intervals. A database span covers the whole call as the application saw it, including network round trips, driver work, fetching results and possibly waiting for a pooled connection. The database reports only server-side execution.
Can APM show execution plans?
Some APM products capture explain plans for slow queries on certain databases; New Relic, for example, documents this for MySQL and PostgreSQL. Products that link APM to database monitoring, such as Datadog's DBM and APM correlation, show plans collected by the database side.
Does OpenTelemetry cover database monitoring?
OpenTelemetry defines how applications describe database calls in traces and metrics (the database semantic conventions). It is application-side instrumentation; server-side waits and query statistics still come from the database engine, through a monitoring tool or its own views.
Which should I set up first?
In our view, the side you own. Application teams on managed databases usually gain most from APM first; teams running shared databases gain most from database monitoring first. Most production systems end up needing both.
Sources
- Microsoft Learn: sys.dm_os_wait_stats
- PostgreSQL documentation: The cumulative statistics system
- PostgreSQL documentation: pg_stat_statements
- OpenTelemetry: Semantic conventions for database client spans
- Datadog documentation: Database Monitoring
- Datadog documentation: Correlate DBM and APM
- New Relic documentation: View slow query details
- New Relic pricing
Checked October 2026.
How we research comparisons: our editorial method.