The Splunk Distribution of OpenTelemetry Collector provides this integration as the MySQL monitor via the Smart Agent Receiver.
This monitor connects to a MySQL instance and reports on the values returned by a
SHOW STATUS command, which include the following:
Number of commands processed
Table and row operations (handlers)
State of the query cache
Status of MySQL threads
To install this integration:
Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform.
Configure the monitor, as described in the next section.
Creating a MySQL user for this monitor 🔗
To create a MySQL user for this monitor:
CREATE USER '<username>'@'localhost' IDENTIFIED BY '<password>'; -- Give appropriate permissions -- ("GRANT USAGE" is synonymous to "no privileges") GRANT USAGE ON *.* TO '<username>'@'localhost'; -- Permissions for the stats options GRANT REPLICATION CLIENT ON *.* TO '<username>'@'localhost';
The new user will only have privileges to connect to the database. Additional privileges are not required.
Note on localhost 🔗
On Unix, MySQL programs treat the host name
localhost specially, in a way
that is likely different from what is expected compared to other
network-based programs. For connections to
localhost, MySQL programs
attempt to connect to the local server by using a Unix socket file. To ensure
that the client makes a TCP/IP connection to the local server specify a host
name value of
127.0.0.1, or the IP address or name of the local server.
You have to specify each database you want to monitor individually under
databases configuration option. If you have a common authentication to all
databases being monitored, you can specify that in the top-level
password options, otherwise they can be specified at the
InnoDB metrics 🔗
If you want to enable InnoDB metrics (
true), be sure that
you granted the
PROCESS privilege to your user.
The Splunk Distribution of OpenTelemetry Collector allows embedding a Smart Agent monitor configuration in an associated Smart Agent Receiver instance.
Note: Providing a MySQL monitor entry in your Smart Agent or Collector configuration is required for its use. Use the appropriate form for your agent type.
Smart Agent 🔗
To activate this monitor in the Smart Agent, add the following to your agent configuration:
monitors: # All monitor config goes under this key - type: collectd/mysql ... # Additional config
See Smart Agent example configuration for an autogenerated example of a YAML configuration file, with default values where applicable.
Splunk Distribution of OpenTelemetry Collector 🔗
To activate this monitor in the Splunk Distribution of OpenTelemetry Collector, add the following to your agent configuration:
receivers: smartagent/mysql: type: collectd/mysql ... # Additional config
To complete the monitor activation, you must also include the
smartagent/mysql receiver item in a
metrics pipeline. To do this, add the receiver item to the
receivers section of your configuration file.
See configuration examples for specific use cases that show how the collector can integrate and complement existing environments.
The following is a sample YAML configuration that shows how to connect multiple MySQL databases:
monitors: - type: collectd/mysql host: 127.0.0.1 port: 3306 databases: - name: dbname - name: securedb username: admin password: s3cr3t username: dbuser password: passwd
The following is a sample YAML configuration that shows how to connect a single MySQL database:
monitors: - type: collectd/mysql host: 127.0.0.1 port: 3306 databases: - name: username: YOURUSERNAMEHERE password: YOURPASSWORDHERE
Configuration settings 🔗
The following table shows the configuration options for the MySQL monitor:
||A list of databases along with optional authentication credentials.|
||These credentials serve as defaults for all databases if not overridden|
||A SignalFx extension to the plugin that allows us to disable the normal behavior of the MySQL plugin where the
databases configuration object has the following fields:
These are the metrics available for this integration.