![]() |
VOOZH | about |
The MySQL receiver allows for collection of MySQL metrics and access to the MySQL Overview dashboard. Configure the receiver according to the specifications of the latest version of the mysqlreceiver.
For more information, see the OpenTelemetry project documentation for the MySQL receiver.
To collect MySQL metrics with OpenTelemetry for use with Datadog:
receivers:
mysql/mysql-host-1:
endpoint: "<HOST>:<PORT>"
username: "<USERNAME>"
password: "<PASSWORD>"
collection_interval: 10s
metrics:
mysql.connection.count:
enabled: true
mysql.connection.errors:
enabled: true
mysql.commands:
enabled: true
mysql.query.slow.count:
enabled: true
mysql.max_used_connections:
enabled: true
processors:
resource/mysql-host-1:
attributes:
- action: insert
key: datadog.host.name
value: <HOST>
transform/mysql-host-1:
metric_statements:
- convert_sum_to_gauge() where metric.name == "mysql.locks"
cumulativetodelta: {}
deltatorate:
metrics:
- mysql.connection.count
- mysql.commands
- mysql.operations
- mysql.query.slow.count
- mysql.connection.errors
- mysql.log_operations
- system.network.io
See the MySQL receiver documentation for detailed configuration options and requirements.
receivers:hostmetrics:scrapers:load:cpu:metrics:system.cpu.utilization:enabled:truememory:network:receivers:filelog:include:- <PATH_TO_YOUR_MYSQL_ERROR_LOG>- <PATH_TO_YOUR_MYSQL_LOG_FILE>operators:- type:json_parserparse_from:bodytimestamp:parse_from:attributes.timestamplayout:"%Y-%m-%dT%H:%M:%SZ"processors:transform/logs:log_statements:- context:resourcestatements:- set(attributes["datadog.host.name"], "<HOST>")- set(attributes["datadog.log.source"], "mysql")batch:{}service:pipelines:metrics/mysql-host-1:receivers:[mysql/mysql-host-1]exporters:[datadog/exporter]processors:[resource/mysql-host-1,cumulativetodelta,deltatorate,transform/mysql-host-1]Add hostmetrics and filelog receiver if you configured them, for example:
receivers:[mysql/mysql-host-1,hostmetrics,filelog]| OTEL | DESCRIPTION | FILTER |
|---|---|---|
| mysql.buffer_pool.data_pages | The number of data pages in the InnoDB buffer pool. | status: dirty |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: read_ahead |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: read_ahead_evicted |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: read_ahead_rnd |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: read_requests |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: reads |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: wait_free |
| mysql.buffer_pool.operations | The number of operations on the InnoDB buffer pool. | operation: write_requests |
| mysql.buffer_pool.page_flushes | The number of requests to flush pages from the InnoDB buffer pool. | |
| mysql.buffer_pool.pages | The number of pages in the InnoDB buffer pool. | kind: data |
| mysql.buffer_pool.pages | The number of pages in the InnoDB buffer pool. | kind: free |
| mysql.buffer_pool.usage | The number of bytes in the InnoDB buffer pool. | |
| mysql.buffer_pool.usage | The number of bytes in the InnoDB buffer pool. | status: dirty |
| mysql.client.network.io | The number of transmitted bytes between server and clients. | kind: received |
| mysql.client.network.io | The number of transmitted bytes between server and clients. | kind: sent |
| mysql.commands | The number of times each type of command has been executed. | command: select |
| mysql.commands | The number of times each type of command has been executed. | command: update |
| mysql.commands | The number of times each type of command has been executed. | command: delete |
| mysql.commands | The number of times each type of command has been executed. | command: insert |
| mysql.connection.count | The number of connection attempts (successful or not) to the MySQL server. | |
| mysql.connection.errors | Errors that occur during the client connection process. | error: aborted |
| mysql.double_writes | The number of writes to the InnoDB doublewrite buffer. | kind: pages_written |
| mysql.double_writes | The number of writes to the InnoDB doublewrite buffer. | kind: writes |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: write |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: update |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: rollback |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_rnd_next |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_rnd |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_prev |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_first |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_key |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: prepare |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: delete |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: commit |
| mysql.handlers | The number of requests to various MySQL handlers. | kind: read_next |
| mysql.joins | The number of joins that perform table scans. | kind: scan |
| mysql.joins | The number of joins that perform table scans. | kind: range_check |
| mysql.joins | The number of joins that perform table scans. | kind: full_range |
| mysql.joins | The number of joins that perform table scans. | kind: range |
| mysql.joins | The number of joins that perform table scans. | kind: full |
| mysql.locks | The number of MySQL locks. | kind: immediate |
| mysql.locks | The number of MySQL locks. | kind: waited |
| mysql.log_operations | The number of InnoDB log operations. | operation: waits |
| mysql.log_operations | The number of InnoDB log operations. | operation: write_requests |
| mysql.log_operations | The number of InnoDB log operations. | operation: writes |
| mysql.log_operations | The number of InnoDB log operations. | operation: fsyncs |
| mysql.max_used_connections | Maximum number of connections used simultaneously since the server started. | |
| mysql.operations | The number of InnoDB operations. | operation: fsyncs |
| mysql.operations | The number of InnoDB operations. | operation: writes |
| mysql.operations | The number of InnoDB operations. | operation: reads |
| mysql.page_operations | The number of InnoDB page operations. | operation: created |
| mysql.page_operations | The number of InnoDB page operations. | operation: read |
| mysql.page_operations | The number of InnoDB page operations. | operation: written |
| mysql.query.slow.count | The number of slow queries. | |
| mysql.replica.time_behind_source | This field is an indication of how “late” the replica is. | |
| mysql.row_locks | The number of InnoDB row locks. | kind: waits |
| mysql.row_locks | The number of InnoDB row locks. | |
| mysql.row_operations | The number of InnoDB row operations. | operation: deleted |
| mysql.row_operations | The number of InnoDB row operations. | operation: inserted |
| mysql.row_operations | The number of InnoDB row operations. | operation: read |
| mysql.row_operations | The number of InnoDB row operations. | operation: updated |
| mysql.sorts | The number of MySQL sorts. | kind: merge_passes |
| mysql.sorts | The number of MySQL sorts. | kind: range |
| mysql.sorts | The number of MySQL sorts. | kind: rows |
| mysql.sorts | The number of MySQL sorts. | kind: scan |
| mysql.table_open_cache | The number of hits, misses or overflows for open tables cache lookups. | status: hit |
| mysql.table_open_cache | The number of hits, misses or overflows for open tables cache lookups. | status: miss |
| mysql.threads | The state of MySQL threads. | kind: cached |
| mysql.threads | The state of MySQL threads. | kind: connected |
| mysql.threads | The state of MySQL threads. | kind: created |
| mysql.threads | The state of MySQL threads. | kind: running |
| mysql.tmp_resources | The number of created temporary resources. | resource: files |
| mysql.tmp_resources | The number of created temporary resources. | resource: disk_tables |
| mysql.tmp_resources | The number of created temporary resources. | resource: tables |
For the full mapping between OpenTelemetry and Datadog metric names, see OpenTelemetry Metrics Mapping.
Additional helpful documentation, links, and articles:
| |