• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

MySQL NRDOT metrics reference

Preview

We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview pursuant to our pre-release policies.

Monitor your MySQL database performance with comprehensive metrics collected by the NRDOT Collector. By default, New Relic collects the metrics referenced in the Default metrics section. You can enhance your monitoring by enabling your desired metrics listed in the Additional metrics section.

Additional metrics

The following metrics are disabled by default but can be enabled for deeper insights into MySQL performance and health. These metrics are organized by functionality and most require a direct MySQL connection.

Log events

db.server.query_sample

Real-time visibility into currently-running database statements — a point-in-time snapshot taken every scrape, not a complete execution log. Disabled by default.

AttributeDescription
db.system.namemysql
mysql.threads.thread_idUnique identifier for the thread executing the statement
mysql.session.idPROCESSLIST_ID — the connection ID visible via SHOW PROCESSLIST
user.nameForeground-thread user; empty for background threads
db.namespaceThread's current database (processlist_db)
mysql.threads.processlist_commandCommand type, or Sleep if idle
mysql.threads.processlist_stateCurrent action/state of the thread
db.query.textSQL statement text
mysql.events_statements_current.digestSHA-256 statement digest
mysql.events_statements_current.timer_startMonotonic picosecond counter marking statement start — a stable per-execution key across scrape cycles
mysql.events_statements_current.timer_waitElapsed execution time, in seconds
mysql.events_waits_current.timer_waitElapsed wait time, in seconds (requires the events_waits_current consumer)
mysql.wait_event_typeTop-level wait classification derived from the wait event name (io, lock, synch), or CPU/User sleep/other when not actually waiting. Paired with mysql.wait_event.
mysql.wait_eventDetailed wait breakdown — the wait event name with its category segment stripped (for example, table/sql/handler, mutex/innodb/checkpoint_state), or CPU/User sleep/other when not actually waiting. Paired with mysql.wait_event_type.
mysql.wait_typeRaw, unprocessed name of the instrument that produced the wait event — for the parsed/categorized breakdown, see mysql.wait_event_type / mysql.wait_event.
mysql.session.statuswaiting, running, or other
mysql.query_plan / mysql.query_plan.hashQuery plan, if available, and its cache key
mysql.event_idThread + current event number when the event started
client.address / client.portClient host/port (port populated on MySQL 8.0.22+ only, else 0)
network.peer.address / network.peer.portSame, as network-layer attributes
mysql.blocking.blockersJSON array of {thread_id, session_id} tuples, one per concurrent InnoDB row-lock blocker for this session — not just the first, if more than one exists. "[]" when not blocked; a blocker's session_id is null if it disconnected before it could be resolved.
mysql.blocking.blocker.countInteger count of concurrent blockers. 0 means not blocked.
mysql.session.client_nameClient driver's self-reported identity (for example, MySQL Connector/J), from session_connect_attrs. Empty if the driver doesn't send connect attributes.
db.query.comment_tags / .nr_service_guidAPM-correlation comment tags — see (Optional) Set up APM-database correlation
db.query.text.normalized.hashMD5 of normalized SQL for cross-engine correlation

Tip

Filter blocking with mysql.blocking.blocker.count > 0, not != 0null != 0 evaluates TRUE in NRQL, which would silently include non-blocked sessions in your results.

db.server.top_query

The queries consuming the most execution time, aggregated server-side by MySQL's own performance_schema.events_statements_summary_by_digest — a true per-digest execution counter, not a sample count. Disabled by default.

AttributeDescription
db.system.namemysql
db.query.textSQL statement text (obfuscated)
db.namespaceDigest's SCHEMA_NAME
mysql.events_statements_summary_by_digest.digestSHA-256 statement digest
mysql.events_statements_summary_by_digest.count_starTimes the statement executed, reported as a per-scrape delta, not cumulative
mysql.events_statements_summary_by_digest.sum_timer_waitTotal execution time, delta seconds
mysql.events_statements_summary_by_digest.sum_rows_examined / .sum_rows_sentDelta row counts — dividing by count_star gives per-execution averages. These are row counts, not logical reads.
mysql.query_plan / mysql.query_plan.hashQuery plan (via EXPLAIN), if available — see Execution plan collection
db.query.comment_tags / .nr_service_guidSame as query_sample
db.query.text.normalized.hashSame as query_sample

Execution plan collection

EXPLAIN needs a literal SQL statement — the normalized digest text uses placeholders (SELECT ? FROM t WHERE id = ?) that MySQL can't execute.

MySQL versionPlan availability
8.0.3+Available — query_sample_text on the digest summary table holds a real statement to EXPLAIN
5.x, 8.0.08.0.2Not available — no query_sample_text to explain

If a captured statement is truncated (ends in ...), EXPLAIN is skipped on every version — see Recommended server parameters.

explain_modeBehavior
inline (default)Runs EXPLAIN FORMAT=json <statement> directly — sufficient for SELECT-only workloads
procedureRoutes through a SQL SECURITY DEFINER procedure (<schema>.explain_statement) so write statements (UPDATE/DELETE/INSERT/REPLACE) can be explained without granting DML to the monitoring user. Falls back to inline if the procedure is missing. Requires the one-time setup step per schema — see Query plans for write statements.

Important

mysql.query_plan is the raw EXPLAIN FORMAT=json output, wrapped in a one-element JSON array before caching, so New Relic's log ingest doesn't auto-flatten and destroy it. Parse index [0] to recover the plan object.

Timer units

Telemetry type

Fields

Unit

Log events (query_sample, top_query)

sum_timer_wait, events_statements_current.timer_wait, events_waits_current.timer_wait

seconds

Metrics (statement events, table/index I/O wait, table lock wait)

per metadata.yaml unit: ns

nanoseconds

Important

mysql.events_waits_current.timer_wait is the one field that is a genuine, distinct wait/block duration (not total elapsed time) — pair it with mysql.wait_event_type / mysql.wait_event (or the raw mysql.wait_type).

Instrumentation in self-hosted environments

Learn how to set up MySQL monitoring in self-hosted environments with New Relic.

Instrumentation in RDS environments

Learn how to set up MySQL monitoring in RDS environments with New Relic.

Troubleshooting guide

Learn how to troubleshoot common issues with MySQL monitoring.

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.