You can use the OpenTelemetry Collector Contrib for MySQL to monitor your instance. The OpenTelemetry Collector Contrib is a community-supported project that collects telemetry data from MySQL and sends it to New Relic.
By default, the OpenTelemetry Collector Contrib collects limited metrics from MySQL. To send query performance, wait-event, session, and client metrics, you'll need to configure the OpenTelemetry Collector Contrib. This guide shows you how to configure it to collect advanced metrics from MySQL and send them to New Relic.
Note
This page covers the community mysqlreceiver shipped in the standard otelcol-contrib binary. If you're using New Relic's distribution (NRDOT), see Self-hosted MySQL instead.
Prerequisites
- OpenTelemetry Collector Contrib (
otelcol-contrib) installed and configured on your system. You can download the latest release from the OpenTelemetry Collector releases page. performance_schemaenabled on the monitored MySQL/MariaDB instance (on by default since MySQL 5.6.6).
Enable UI metrics
You can enrich your New Relic platform experience by adding and enabling metrics in your otelcol-contrib configuration file. Using the configuration provided in this section, you can populate data for the following pages in the New Relic platform:
Overview
Query performance
Wait events
Sessions
Clients
Restart the OpenTelemetry Collector
Restart the OpenTelemetry Collector to apply the configuration changes by running the following command:
$sudo systemctl restart otelcol-contrib