Docs ยป Supported integrations in Splunk Observability Cloud ยป Collector components: Receivers ยป MySQL receiver

MySQL receiver ๐Ÿ”—

The MySQL receiver queries and retrieves metrics about MySQLโ€™s global status and InnoDB tables. The supported pipeline type is metrics. See Process your data with pipelines for more information.

Prerequisites and requirements ๐Ÿ”—

This receiver supports MySQL version 8.0.

Requirements to collect metrics ๐Ÿ”—

The following applies:

  • To collect most metrics, you need to be able to execute SHOW GLOBAL STATUS.

  • Some metrics donโ€™t appear if their corresponding feature is inactive.

  • To collect optional metrics you must specify them your configuration.

For the full list of available metrics, see Metrics.

Get started ๐Ÿ”—

Follow these steps to configure and activate the component:

  1. Deploy the Splunk Distribution of the OpenTelemetry Collector to your host or container platform:

  1. Configure the MySQL receiver as described in the next section.

  2. Restart the Collector.

Sample configuration ๐Ÿ”—

To activate the receiver, add mysql to the receivers section of your configuration file:

receivers:
  mysql:
    endpoint: localhost:3306
    username: otel
    password: ${env:MYSQL_PASSWORD}
    database: otel
    collection_interval: 10s
    initial_delay: 1s
    statement_events:
      digest_text_limit: 120
      time_limit: 24h
      limit: 250

Next, include the receiver in the metrics pipeline of the service section of your configuration file:

service:
  pipelines:
    metrics:
      receivers:
        - mysql

The following settings are optional:

  • endpoint. localhost:3306 by default.

  • tls. Defines the TLS configuration to use. If tls is not set, the default is to disable TLS connections.

    • insecure. false by default. Set to true to disable TLS connections.

    • insecure_skip_verify. false by default. Set to true to enable TLS but not verify the certificate.

    • server_name_override. Use this to set the ServerName in the TLSConfig.

  • username. root by default.

  • password. The password to the username.

  • allow_native_passwords. true by default.

  • database. The database name. If unspecified, metrics are collected for all databases.

  • collection_interval. 10s by default. Sets the interval this receiver collects metrics on.

    • This value must be a string readable by Golangโ€™s time.ParseDuration. Learn more at Goโ€™s official documentation ParseDuration function .

    • Valid time units are ns, us (or ยตs), ms, s, m, h.

  • initial_delay. 1s by default. Determines how long this receiver waits before collecting metrics for the first time.

  • transport. tcp by default. Defines the network to use to connect to the server.

  • statement_events. Additional configuration for the queries that build mysql.statement_events.count and mysql.statement_events.wait.time metrics:

    • digest_text_limit. 120 by default. Maximum length of digest_text. Longer text is truncated.

    • time_limit. 24h by default. Maximum time from since the statements have been observed last time.

    • limit. 250 by default. Limit of records, which is maximum number of generated metrics.

Settings ๐Ÿ”—

The following table shows the configuration options for the MySQL receiver:

NameTypeDefaultDescription
collection_intervalint6410s

CollectionInterval sets how frequently the scraper should be called and used as the context timeout to ensure that scrapers don't exceed the interval.

initial_delayint641s

InitialDelay sets the initial start delay for the scraper, any non positive value is assumed to be immediately.

timeoutint64

Timeout is an optional value used to set scraper's context deadline.

usernamestringroot
passwordstring
databasestring
allow_native_passwordsbooltrue
endpointstringlocalhost:3306
transportstringtcp
dialer (see fields)struct
tls (see fields)struct

ClientConfig contains TLS configurations that are specific to client connections in addition to the common configurations. This should be used by components configuring TLS client connections.

metrics (see fields)struct

MetricsConfig provides config for mysql metrics.

resource_attributes (see fields)struct

ResourceAttributesConfig provides config for mysql resource attributes.

statement_events (see fields)struct

Fields of dialer

NameTypeDefaultDescription
timeoutint64

Fields of tls

NameTypeDefaultDescription
ca_filestring

Path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA. (optional)

ca_pemstring

In memory PEM encoded cert. (optional)

include_system_ca_certs_poolboolfalse

If true, load system CA certificates pool in addition to the certificates configured in this struct.

cert_filestring

Path to the TLS cert to use for TLS required connections. (optional)

cert_pemstring

In memory PEM encoded TLS cert to use for TLS required connections. (optional)

key_filestring

Path to the TLS key to use for TLS required connections. (optional)

key_pemstring

In memory PEM encoded TLS key to use for TLS required connections. (optional)

min_versionstring

MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional)

max_versionstring

MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional)

cipher_suitesslice

CipherSuites is a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.

reload_intervalint64

ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional)

insecureboolfalse

In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false)

insecure_skip_verifyboolfalse

InsecureSkipVerify will enable TLS but not verify the certificate.

server_name_overridestring

ServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)

Fields of metrics

NameTypeDefaultDescription
mysql.buffer_pool.data_pagesstruct

MetricConfig provides common config for a particular metric.

mysql.buffer_pool.limitstruct

MetricConfig provides common config for a particular metric.

mysql.buffer_pool.operationsstruct

MetricConfig provides common config for a particular metric.

mysql.buffer_pool.page_flushesstruct

MetricConfig provides common config for a particular metric.

mysql.buffer_pool.pagesstruct

MetricConfig provides common config for a particular metric.

mysql.buffer_pool.usagestruct

MetricConfig provides common config for a particular metric.

mysql.client.network.iostruct

MetricConfig provides common config for a particular metric.

mysql.commandsstruct

MetricConfig provides common config for a particular metric.

mysql.connection.countstruct

MetricConfig provides common config for a particular metric.

mysql.connection.errorsstruct

MetricConfig provides common config for a particular metric.

mysql.double_writesstruct

MetricConfig provides common config for a particular metric.

mysql.handlersstruct

MetricConfig provides common config for a particular metric.

mysql.index.io.wait.countstruct

MetricConfig provides common config for a particular metric.

mysql.index.io.wait.timestruct

MetricConfig provides common config for a particular metric.

mysql.joinsstruct

MetricConfig provides common config for a particular metric.

mysql.locksstruct

MetricConfig provides common config for a particular metric.

mysql.log_operationsstruct

MetricConfig provides common config for a particular metric.

mysql.mysqlx_connectionsstruct

MetricConfig provides common config for a particular metric.

mysql.mysqlx_worker_threadsstruct

MetricConfig provides common config for a particular metric.

mysql.opened_resourcesstruct

MetricConfig provides common config for a particular metric.

mysql.operationsstruct

MetricConfig provides common config for a particular metric.

mysql.page_operationsstruct

MetricConfig provides common config for a particular metric.

mysql.prepared_statementsstruct

MetricConfig provides common config for a particular metric.

mysql.query.client.countstruct

MetricConfig provides common config for a particular metric.

mysql.query.countstruct

MetricConfig provides common config for a particular metric.

mysql.query.slow.countstruct

MetricConfig provides common config for a particular metric.

mysql.replica.sql_delaystruct

MetricConfig provides common config for a particular metric.

mysql.replica.time_behind_sourcestruct

MetricConfig provides common config for a particular metric.

mysql.row_locksstruct

MetricConfig provides common config for a particular metric.

mysql.row_operationsstruct

MetricConfig provides common config for a particular metric.

mysql.sortsstruct

MetricConfig provides common config for a particular metric.

mysql.statement_event.countstruct

MetricConfig provides common config for a particular metric.

mysql.statement_event.wait.timestruct

MetricConfig provides common config for a particular metric.

mysql.table.average_row_lengthstruct

MetricConfig provides common config for a particular metric.

mysql.table.io.wait.countstruct

MetricConfig provides common config for a particular metric.

mysql.table.io.wait.timestruct

MetricConfig provides common config for a particular metric.

mysql.table.lock_wait.read.countstruct

MetricConfig provides common config for a particular metric.

mysql.table.lock_wait.read.timestruct

MetricConfig provides common config for a particular metric.

mysql.table.lock_wait.write.countstruct

MetricConfig provides common config for a particular metric.

mysql.table.lock_wait.write.timestruct

MetricConfig provides common config for a particular metric.

mysql.table.rowsstruct

MetricConfig provides common config for a particular metric.

mysql.table.sizestruct

MetricConfig provides common config for a particular metric.

mysql.table_open_cachestruct

MetricConfig provides common config for a particular metric.

mysql.threadsstruct

MetricConfig provides common config for a particular metric.

mysql.tmp_resourcesstruct

MetricConfig provides common config for a particular metric.

mysql.uptimestruct

MetricConfig provides common config for a particular metric.

Fields of mysql.buffer_pool.data_pages

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.buffer_pool.limit

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.buffer_pool.operations

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.buffer_pool.page_flushes

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.buffer_pool.pages

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.buffer_pool.usage

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.client.network.io

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.commands

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.connection.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.connection.errors

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.double_writes

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.handlers

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.index.io.wait.count

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.index.io.wait.time

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.joins

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.locks

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.log_operations

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.mysqlx_connections

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.mysqlx_worker_threads

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.opened_resources

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.operations

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.page_operations

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.prepared_statements

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.query.client.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.query.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.query.slow.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.replica.sql_delay

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.replica.time_behind_source

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.row_locks

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.row_operations

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.sorts

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.statement_event.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.statement_event.wait.time

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.average_row_length

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.io.wait.count

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.table.io.wait.time

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.table.lock_wait.read.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.lock_wait.read.time

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.lock_wait.write.count

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.lock_wait.write.time

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.rows

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table.size

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.table_open_cache

NameTypeDefaultDescription
enabledboolfalse

Fields of mysql.threads

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.tmp_resources

NameTypeDefaultDescription
enabledbooltrue

Fields of mysql.uptime

NameTypeDefaultDescription
enabledbooltrue

Fields of resource_attributes

NameTypeDefaultDescription
mysql.instance.endpointstruct

ResourceAttributeConfig provides common config for a particular resource attribute.

Fields of mysql.instance.endpoint

NameTypeDefaultDescription
enabledbooltrue
metrics_include (see fields)slice

Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted.

metrics_exclude (see fields)slice

Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude.

Fields of metrics_include

NameTypeDefaultDescription
strictstring
regexpstring

Fields of metrics_exclude

NameTypeDefaultDescription
strictstring
regexpstring

Fields of statement_events

NameTypeDefaultDescription
digest_text_limitint120
limitint250
time_limitint6424h0m0s

Metrics ๐Ÿ”—

The following metrics, resource attributes, and attributes, are available.

NameTypeUnit ActiveDescriptionAttributes
mysql.buffer_pool.pagesSumYes

The number of pages in the InnoDB buffer pool.

mysql.buffer_pool.data_pagesSumYes

The number of data pages in the InnoDB buffer pool.

mysql.buffer_pool.page_flushesSumYes

The number of requests to flush pages from the InnoDB buffer pool.

mysql.buffer_pool.operationsSumYes

The number of operations on the InnoDB buffer pool.

mysql.buffer_pool.limitSumByYes

The configured size of the InnoDB buffer pool.

mysql.buffer_pool.usageSumByYes

The number of bytes in the InnoDB buffer pool.

mysql.prepared_statementsSumYes

The number of times each type of prepared statement command has been issued.

mysql.commandsSumNo

The number of times each type of command has been executed.

mysql.handlersSumYes

The number of requests to various MySQL handlers.

mysql.double_writesSumYes

The number of writes to the InnoDB doublewrite buffer.

mysql.log_operationsSumYes

The number of InnoDB log operations.

mysql.operationsSumYes

The number of InnoDB operations.

mysql.page_operationsSumYes

The number of InnoDB page operations.

mysql.table.io.wait.countSumYes

The total count of I/O wait events for a table.

mysql.table.io.wait.timeSumnsYes

The total time of I/O wait events for a table.

mysql.table.rowsSumNo

The number of rows for a given table.

mysql.table.average_row_lengthSumByNo

The average row length in bytes for a given table.

mysql.table.sizeSumByNo

The table size in bytes for a given table.

mysql.index.io.wait.countSumYes

The total count of I/O wait events for an index.

mysql.index.io.wait.timeSumnsYes

The total time of I/O wait events for an index.

mysql.row_locksSumYes

The number of InnoDB row locks.

mysql.row_operationsSumYes

The number of InnoDB row operations.

mysql.locksSumYes

The number of MySQL locks.

mysql.sortsSumYes

The number of MySQL sorts.

mysql.threadsSumYes

The state of MySQL threads.

mysql.client.network.ioSumByNo

The number of transmitted bytes between server and clients.

mysql.opened_resourcesSumYes

The number of opened resources.

mysql.uptimeSumsYes

The number of seconds that the server has been up.

mysql.table.lock_wait.read.countSumNo

The total table lock wait read events.

mysql.table.lock_wait.read.timeSumnsNo

The total table lock wait read events times.

mysql.table.lock_wait.write.countSumNo

The total table lock wait write events.

mysql.table.lock_wait.write.timeSumnsNo

The total table lock wait write events times.

mysql.connection.countSumNo

The number of connection attempts (successful or not) to the MySQL server.

mysql.connection.errorsSumNo

Errors that occur during the client connection process.

mysql.mysqlx_connectionsSumYes

The number of mysqlx connections.

mysql.joinsSumNo

The number of joins that perform table scans.

mysql.tmp_resourcesSumYes

The number of created temporary resources.

mysql.replica.time_behind_sourceSumsNo

This field is an indication of how โ€œlateโ€ the replica is.

mysql.replica.sql_delaySumsNo

The number of seconds that the replica must lag the source.

mysql.statement_event.countSumNo

Summary of current and recent statement events.

mysql.statement_event.wait.timeSumnsNo

The total wait time of the summarized timed events.

mysql.mysqlx_worker_threadsSumNo

The number of worker threads available.

mysql.table_open_cacheSumNo

The number of hits, misses or overflows for open tables cache lookups.

mysql.query.client.countSumNo

The number of statements executed by the server. This includes only statements sent to the server by clients.

mysql.query.countSumNo

The number of statements executed by the server.

mysql.query.slow.countSumNo

The number of slow queries.

Resource Attributes

NameType Description
mysql.instance.endpointstring

Endpoint of the MySQL instance.

Attributes

NameType Description Values
buffer_pool_pagesstring

The buffer pool pages types.

  • data
  • free
  • misc
buffer_pool_datastring

The status of buffer pool data.

  • dirty
  • clean
buffer_pool_operationsstring

The buffer pool operations types.

  • read_ahead_rnd
  • read_ahead
  • read_ahead_evicted
  • read_requests
  • reads
  • wait_free
  • write_requests
prepared_statements_commandstring

The prepare statement command types.

  • execute
  • close
  • fetch
  • prepare
  • reset
  • send_long_data
commandstring

The command types.

  • delete
  • delete_multi
  • insert
  • select
  • update
  • update_multi
connection_errorstring

The connection error type.

  • accept
  • internal
  • max_connections
  • peer_address
  • select
  • tcpwrap
  • aborted
  • aborted_clients
  • locked
handlerstring

The handler types.

  • commit
  • delete
  • discover
  • external_lock
  • mrr_init
  • prepare
  • read_first
  • read_key
  • read_last
  • read_next
  • read_prev
  • read_rnd
  • read_rnd_next
  • rollback
  • savepoint
  • savepoint_rollback
  • update
  • write
double_writesstring

The doublewrite types.

  • pages_written
  • writes
log_operationsstring

The log operation types.

  • waits
  • write_requests
  • writes
operationsstring

The operation types.

  • fsyncs
  • reads
  • writes
page_operationsstring

The page operation types.

  • created
  • read
  • written
row_locksstring

The row lock type.

  • waits
  • time
row_operationsstring

The row operation type.

  • deleted
  • inserted
  • read
  • updated
locksstring

The table locks type.

  • immediate
  • waited
sortsstring

The sort count type.

  • merge_passes
  • range
  • rows
  • scan
threadsstring

The thread count type.

  • cached
  • connected
  • created
  • running
schemastring

The schema of the object.

io_waits_operationsstring

The io_waits operation type.

  • delete
  • fetch
  • insert
  • update
table_namestring

Table name for event or process.

index_namestring

The name of the index.

directionstring

The name of the transmission direction.

  • received
  • sent
digeststring

Digest.

digest_textstring

Text before digestion.

event_statestring

Possible event states.

  • errors
  • warnings
  • rows_affected
  • rows_sent
  • rows_examined
  • created_tmp_disk_tables
  • created_tmp_tables
  • sort_merge_passes
  • sort_rows
  • no_index_used
opened_resourcesstring

The kind of the resource.

  • file
  • table_definition
  • table
join_kindstring

The kind of join.

  • full
  • full_range
  • range
  • range_check
  • scan
read_lock_typestring

Read operation types.

  • normal
  • with_shared_locks
  • high_priority
  • no_insert
  • external
write_lock_typestring

Write operation types.

  • allow_write
  • concurrent_insert
  • low_priority
  • normal
  • external
tmp_resourcestring

The kind of temporary resources.

  • disk_tables
  • files
  • tables
mysqlx_threadsstring

The worker thread count kind.

  • available
  • active
connection_statusstring

The connection status.

  • accepted
  • closed
  • rejected
cache_statusstring

The status of cache access.

  • hit
  • miss
  • overflow
table_size_typestring

The table size types.

  • data
  • index

Activate or deactivate specific metrics ๐Ÿ”—

You can activate or deactivate specific metrics by setting the enabled field in the metrics section for each metric. For example:

receivers:
  samplereceiver:
    metrics:
      metric-one:
        enabled: true
      metric-two:
        enabled: false

The following is an example of host metrics receiver configuration with activated metrics:

receivers:
  hostmetrics:
    scrapers:
      process:
        metrics:
          process.cpu.utilization:
            enabled: true

Note

Deactivated metrics arenโ€™t sent to Splunk Observability Cloud.

Billing ๐Ÿ”—

  • If youโ€™re in a MTS-based subscription, all metrics count towards metrics usage.

  • If youโ€™re in a host-based plan, metrics listed as active (Active: Yes) on this document are considered default and are included free of charge.

Learn more at Infrastructure Monitoring subscription usage (Host and metric plans).

Troubleshooting ๐Ÿ”—

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers .

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.

This page was last updated on Feb 11, 2025.