You can install and configure MySQL monitoring on Kubernetes using the mysql-otel Helm chart. Optionally, the chart can also run a setup job that creates the monitoring user for you.
중요
The chart deploys the collector as a Kubernetes Deployment that reaches MySQL remotely over the network. As a result it always connects over TCP (Unix-socket monitoring isn't supported), and it reports MySQL metrics only (no host or infrastructure metrics for the machine MySQL runs on). Using mysql.*, it monitors one MySQL instance per release; to monitor several instances from a single release, use mysqlMulti.* instead (see Monitor multiple instances from one release below).
Prerequisites
- A valid New Relic license key.
- MySQL 5.7 or later.
- Helm 3.0 or later, and
kubectlconfigured to access your Kubernetes cluster. - Network connectivity from your Kubernetes cluster to the MySQL host (or RDS endpoint) and port:
- Self-hosted: a routed path to the MySQL host (VPN, peering, or shared network), DNS resolution if it's a hostname, and the MySQL-side firewall must allow the connection's actual source IP (which may be a NAT gateway, not the pod IP itself).
- AWS RDS: VPC peering, a transit gateway, or shared-VPC placement with the RDS instance, and the RDS security group must allow the MySQL port (
3306by default) from the cluster's egress source.
- Either a monitoring user you've already created, or MySQL admin credentials so the chart's setup job can create one for you. See Configure monitoring credentials below.
Create the namespace
Create the namespace you'll install into. It must exist before you create any secrets in the next step, since helm install --create-namespace only creates the namespace during the final install step:
$kubectl create namespace newrelic팁
Set it as the default namespace for your current kubectl context so you don't need to pass -n on every command below:
$kubectl config set-context --current --namespace=newrelicConfigure monitoring credentials
Decide whether you want the chart's setup job to create the MySQL monitoring user for you, and if not, how you'll supply its credentials:
Configure the Helm values
Set mysql.topology to match your environment:
Value | Description |
|---|---|
| Self-hosted MySQL, reached over the network. |
| MySQL or Aurora on AWS RDS. |
Use the values.yaml that matches the credential method you chose in the previous step:
Parameter | Description |
|---|---|
| Your New Relic license key. |
| Your region's OTLP/gRPC endpoint, as a bare |
| Your MySQL host (or RDS endpoint) and port, reachable from the cluster. |
| Optional. Restrict monitoring to one database. Leave empty to monitor all databases. |
| Optional. The chart doesn't declare a |
| The |
| Optional. Also grants |
팁
See the chart's values.yaml for all available configuration options, including mysql.collectionInterval, mysql.explainMode, the statementEvents/querySampleCollection/topQueryCollection blocks, and the additionalReceiverConfig escape hatch.
(Optional) Monitor multiple instances from one release
Instead of mysql.*, set mysqlMulti.enabled: true to monitor several MySQL instances (self-hosted or RDS) from a single collector pod in one release. The two modes are mutually exclusive: don't set mysql.server and mysqlMulti.enabled: true in the same release.
Multi-instance mode has no plain-username/password path: every instance needs its own Kubernetes secret with monitoring credentials. Decide whether you also want the setup job to create each monitoring user for you:
Parameter | Description |
|---|---|
| Set to |
|
|
| List of instances to monitor. Each entry requires a unique |
팁
Scrape settings (collection interval, TLS, statement events, query sample collection, top query collection) apply identically to every instance in mysqlMulti.databases. There's no per-instance override. Use additionalReceiverConfig for anything that needs to differ. The setup job runs once per instance (<release>-setup-<name>) rather than once per release.
Install the Helm chart
Add the New Relic Helm repository:
bash$helm repo add newrelic https://helm-charts.newrelic.com$helm repo updateInstall the chart using your
values.yamlfile:bash$helm upgrade --install mysql-otel newrelic/mysql-otel \>-n newrelic \>--create-namespace \>-f values.yaml
Verify the installation
Check that the setup job completed (if enabled) and the collector pod is running:
bash$kubectl get jobs,pods -n newrelic --watchRun this query in the query builder to confirm data is arriving:
SELECT count(*) FROM MetricWHERE metricName LIKE 'mysql.%'AND instrumentation.provider = 'opentelemetry'SINCE 10 minutes ago
Find and use your data
Once your data is being collected, you can access comprehensive MySQL database monitoring through the New Relic UI.
To find your MySQL database entity in New Relic:
- Go to one.newrelic.com > All capabilities > Databases.
- From the Entity type dropdown, select MySQL instance, then click Apply.
- Select your MySQL database from the list of entities.
Related documentation
Introduction to MySQL monitoring with NRDOT
Learn about all the available installation methods for MySQL monitoring with New Relic.
CLI install
Learn how to install and configure MySQL monitoring with a single New Relic CLI command.
Ansible install
Learn how to install and configure MySQL monitoring at scale with the newrelic.newrelic_install Ansible role.
Chef install
Learn how to install and configure MySQL monitoring at scale with the newrelic-install Chef cookbook.