Monitoring MySQL with OpenTelemetry means collecting database metrics through the OpenTelemetry Collector's MySQL receiver over OTLP, so MySQL health is correlated with the applications that depend on it..
Monitoring MySQL with OpenTelemetry means collecting database metrics through the OpenTelemetry Collector's MySQL receiver over OTLP, so MySQL health is correlated with the applications that depend on it.
The signals that predict MySQL trouble are connection usage against max_connections, query throughput and slow queries, InnoDB buffer-pool efficiency, lock waits and deadlocks, and replication lag. As with any relational database, slow queries and locking are the common paths to user-facing latency, and a buffer pool that no longer holds the working set turns fast reads into disk reads.
The highest-value view ties a slow application request to the exact statement behind it, so database metrics are most useful alongside application spans that carry the SQL as an attribute.
The Collector's mysql receiver connects as a monitoring user and reads the server and InnoDB status, emitting connection, throughput, buffer-pool, lock and handler metrics over OTLP. The slow-query log, enabled with long_query_time, is collected with the filelog receiver so the actual slow statements are visible.
The permission detail is the monitoring user: grant it the process and replication-client privileges and read on the performance schema, or the receiver returns partial data. Application spans carrying the statement complete the picture.
The signals that explain most MySQL incidents:
| Signal | Source | What it tells you / watch for |
|---|---|---|
mysql.threads (connected) | mysql receiver | Active connections; approaching max_connections leads to 'too many connections' errors. |
mysql.buffer_pool.usage / operations | mysql receiver | Buffer-pool efficiency; rising reads-from-disk means the working set no longer fits in the pool. |
mysql.locks / row_locks | mysql receiver | Lock waits; a climbing count is contention that turns into latency. |
mysql.commands | mysql receiver | Query throughput by type; a sudden drop or a spike in a command type is worth explaining. |
deadlocks | mysql receiver / logs | Deadlocks per interval; a rising count is a contention pattern to fix. |
replication lag | query / receiver | Seconds a replica is behind the source; growing lag means stale reads. |
A MySQL dashboard should answer: are we out of connections, is the buffer pool still absorbing reads, and is anything locked or lagging. Row one: connections against max_connections and slow-query rate. Row two: buffer-pool hit efficiency and lock waits/deadlocks. Row three: replication lag per replica and throughput by command type.
# connection saturation
mysql.threads{kind="connected"} / mysql_max_connections
# buffer pool read efficiency (disk reads climbing = pool too small)
rate(mysql.buffer_pool.operations{operation="reads"}[5m])
# lock waits trending up = contention
rate(mysql.locks[5m])
Applications hit 'too many connections' and latency spikes as requests wait for a slot. Connected threads sit at max_connections. The cause is usually a missing connection pooler or a leak of unclosed connections; pool in front of MySQL rather than only raising the limit.
Read latency and disk I/O rise because queries are reading from disk instead of the InnoDB buffer pool. The disk-read counter climbs. Either the working set has outgrown the pool or a query is scanning far more rows than needed, findable in the slow-query log.
Some transactions stall or roll back while others proceed, and deadlock counts rise, because concurrent transactions contend for the same rows in a conflicting order. Find the statements involved; the fix is usually indexing, shorter transactions, or a consistent lock order.
Starting thresholds to tune:
| Condition | Signal | Meaning |
|---|---|---|
| connected threads / max > 0.85 for 5m | connections | Connection exhaustion approaching. |
| buffer-pool disk reads rising for 15m | cache | Working set spilling to disk. |
| deadlocks increasing over 10m | contention | A contention pattern is developing. |
| replication lag > 30s for 5m | replication | Replicas serving stale data. |
Ops Singularity's TelemetryOps ingests MySQL telemetry over OpenTelemetry, and Sentinel AI resolves database incidents through governed Action Tickets. Explore TelemetryOps.
Use the OpenTelemetry Collector's mysql receiver for server and InnoDB metrics and the filelog receiver for slow-query and error logs, exported over OTLP.
Connection usage, slow-query rate, InnoDB buffer pool hit ratio, lock waits and deadlocks, and replication lag.
Bring a real incident. We will show you Sentinel investigate, act and verify end to end, with every action reversible and audited.