MySQL receiver
The MySQL receiver allows the Splunk Distribution of the OpenTelemetry Collector to query and retrieve metrics about MySQL's global status and InnoDB tables.
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:
-
Deploy the Splunk Distribution of the OpenTelemetry Collector to your host or container platform:
-
Configure the MySQL receiver as described in the next section.
-
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:3306by default. -
tls. Defines the TLS configuration to use. Iftlsis not set, the default is to deactivate TLS connections.-
insecure.falseby default. Set totrueto deactivate TLS connections. -
insecure_skip_verify.falseby default. Set totrueto activate TLS but not verify the certificate. -
server_name_override. Use this to set the ServerName in the TLSConfig.
-
-
username.rootby default. -
password. The password to the username. -
allow_native_passwords.trueby default. -
database. The database name. If unspecified, metrics are collected for all databases.
-
collection_interval.10sby 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.1sby default. Determines how long this receiver waits before collecting metrics for the first time.
-
transport.tcpby default. Defines the network to use to connect to the server. -
statement_events. Additional configuration for the queries that buildmysql.statement_events.countandmysql.statement_events.wait.timemetrics:-
digest_text_limit.120by default. Maximum length ofdigest_text. Longer text is truncated. -
time_limit.24hby default. Maximum time from since the statements were observed last time. -
limit.250by default. Limit of records, which is maximum number of generated metrics.
-
Settings
The following table shows the configuration options for the MySQL receiver:
included
https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/mysql.yaml
Metrics
The following metrics, resource attributes, and attributes, are available.
included
https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/mysqlreceiver.yaml
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
-
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
Submit a case in the Splunk Support Portal.
Contact Splunk Support.
Available to prospective customers and free trial users
Ask a question and get answers through community support at Splunk Answers.
Join the Splunk community #observability Slack channel to communicate with customers, partners, and Splunk employees worldwide.