• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Install & configure NRDOT for MySQL monitoring with Azure flexible server

|View as Markdown (English)

Set up MySQL monitoring using the NRDOT Collector for Azure Database for MySQL flexible server instances. Azure Flexible Server environments have specific considerations for privileges and platform limitations.

Prerequisites

Before you install, make sure you have:

  • A New Relic license key.
  • Network connectivity between the host where you install the NRDOT Collector and your Azure Database for MySQL flexible server instance.
  • Network connectivity to New Relic OTLP endpoints documentation
  • Azure Flexible Server admin login credentials.

For supported MySQL versions, required grants, and performance_schema requirements, see Compatibility and prerequisites.

Set up NRDOT Collector

Install the NRDOT Collector on a system that can connect to your Azure Database for MySQL flexible server instance:

Configure database user

Create a monitoring user with the necessary privileges for your Azure Database for MySQL flexible server instance.

  1. To create a monitoring user, connect to your instance as the Azure Flexible Server admin login (there's no root account) and run:

    CREATE USER '<YOUR_DB_USERNAME>'@'%' IDENTIFIED BY '<YOUR_DB_PASSWORD>';
  2. To collect query samples and top queries, grant the following privileges to the monitoring user:

    GRANT SELECT ON performance_schema.* TO '<YOUR_DB_USERNAME>'@'%';
    GRANT SELECT ON *.* TO '<YOUR_DB_USERNAME>'@'%';
    GRANT REPLICATION CLIENT ON *.* TO '<YOUR_DB_USERNAME>'@'%';
    GRANT PROCESS ON *.* TO '<YOUR_DB_USERNAME>'@'%';

    Important

    Granting BACKUP_ADMIN isn't supported on Azure Database for MySQL - Flexible Server. As a result, mysql.innodb.redo_log.checkpoint.age, mysql.innodb.redo_log.lsn.checkpoint, and mysql.innodb.redo_log.lsn.current are unavailable.

  3. (Optional) To view the wait-time data in New Relic platform, grant the following privileges to the monitoring user:

    GRANT UPDATE ON performance_schema.setup_consumers TO '<YOUR_DB_USERNAME>'@'%';
  4. (Optional) To verify the connection and grants, run:

    bash
    $
    mysql -h <YOUR_DB_HOST> -P <YOUR_DB_PORT> -u <YOUR_DB_USERNAME> -p -e "SELECT 1;"

    If the command completes without an error, the monitoring user, host, and port are all correct.

Configure NRDOT Collector

Configure the NRDOT Collector with your Azure Database for MySQL flexible server-specific settings.

This configuration focuses on essential MySQL monitoring with the nrmysql receiver only.

full configuration

This baseline configuration captures essential metrics. To see the complete metric catalog, refer to the configuration reference.

  1. Create a configuration file named mysql-config.yaml:

    bash
    $
    sudo nano /etc/nrdot-collector/mysql-config.yaml
  2. Add the following configuration to the mysql-config.yaml file you created in the previous step.

mysql-config.yaml
1
receivers:
2
nrmysql:
3
endpoint: "myserver.mysql.database.azure.com:3306"
4
transport: tcp
5
username: "newrelic"
6
password: "YOUR_PASSWORD"
7
allow_native_passwords: true
8
collection_interval: 15s
9
initial_delay: 1s
10
explain_mode: procedure
11
statement_events:
12
digest_text_limit: 4096
13
time_limit: 24h
14
limit: 500
15
query_sample_collection:
16
max_rows_per_query: 100
17
allowed_comment_keys: [nr_service_guid]
18
top_query_collection:
19
lookback_time: 60
20
max_query_sample_count: 5000
21
top_query_count: 200
22
collection_interval: 60s
23
query_plan_cache_size: 1000
24
query_plan_cache_ttl: 1h
25
allowed_comment_keys: [nr_service_guid]
26
events:
27
db.server.query_sample:
28
enabled: true
29
db.server.top_query:
30
enabled: true
31
db.server.query_plan:
32
enabled: true
33
resource_attributes:
34
db.system.version:
35
enabled: true
36
metrics:
37
mysql.query.count:
38
enabled: true
39
mysql.query.slow.count:
40
enabled: true
41
mysql.commands:
42
enabled: true
43
mysql.innodb.data_file.io:
44
enabled: true
45
# Azure Database for MySQL flexible server enforces TLS by default (require_secure_transport).
46
tls:
47
insecure: false
48
ca_file: <PATH_TO_AZURE_CA_CERTIFICATE>
49
50
processors:
51
batch:
52
53
exporters:
54
otlp/newrelic:
55
endpoint: "https://otlp.nr-data.net:4318"
56
headers:
57
api-key: "YOUR_LICENSE_KEY"
58
compression: gzip
59
retry_on_failure:
60
enabled: true
61
initial_interval: 5s
62
max_interval: 30s
63
max_elapsed_time: 300s
64
65
service:
66
pipelines:
67
metrics:
68
receivers: [nrmysql]
69
processors: [batch]
70
exporters: [otlp/newrelic]
71
logs:
72
receivers: [nrmysql]
73
processors: [batch]
74
exporters: [otlp/newrelic]

Conseil

This configuration omits the optional database field. By default, the receiver monitors every database the monitoring user can access. To monitor a specific database, see Enable detailed insights.

Configuration parameters

The following table describes the key configuration parameters for the nrmysql receiver:

ParameterDescription
<YOUR_DB_HOST>Your Azure Database for MySQL flexible server endpoint. For example, myserver.mysql.database.azure.com
<YOUR_DB_PORT>Enter your MySQL port number. The default value is 3306.
<YOUR_DB_USERNAME>Enter the username of the monitoring user you created in Configure database user.
<YOUR_DB_PASSWORD>Enter the password of the monitoring user you created in Configure database user.
<YOUR_NEWRELIC_OTLP_ENDPOINT>Enter the New Relic OTLP endpoint. For more information, see New Relic OTLP endpoints.
<YOUR_NEWRELIC_LICENSE_KEY>Enter your New Relic license key.
transportDefault value is set to tcp to connect over the network.
collection_intervalEnter the interval between metric scrapes. Default: 15s.
explain_modeDefault value is set to inline. Set the value to procedure to collect query plans for write statements without granting DML privileges to the monitoring user. See Query plans for write statements.

Validate NRDOT Collector configuration

  1. Update the config path to point to your new mysql-config.yaml file:

    bash
    $
    sudo sed -i 's|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/config.yaml"|OTELCOL_OPTIONS="--config=/etc/nrdot-collector/mysql-config.yaml"|' /etc/nrdot-collector/nrdot-collector.conf
  2. Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly:

    bash
    $
    sudo /usr/bin/nrdot-collector validate --config=/etc/nrdot-collector/mysql-config.yaml

    Conseil

    You can also:

    • Configure multiple receivers: To monitor multiple MySQL instances from one collector.
    • Link your MySQL database with APM: To correlate your application performance with database operations. This allows you to see exactly which applications are generating specific database workloads.
    • Set up secret management: To securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files.

Restart NRDOT Collector

  • After updating your configuration, restart the NRDOT Collector service:

    bash
    $
    sudo systemctl restart nrdot-collector

    Conseil

    Always restart the NRDOT Collector service after making configuration changes to ensure the new settings take effect.

  • To verify that the collector is running properly, check the service status:

    bash
    $
    sudo systemctl status nrdot-collector

Find and use your data

Once your data is being collected, you can access comprehensive Azure Database for MySQL flexible server monitoring through the New Relic UI.

To find your Azure Database for MySQL flexible server entity in New Relic:

  1. Go to https://one.newrelic.com > All Capabilities > Databases.
  2. From the Entity type dropdown, select MySQL instance, then click Apply.
  3. Select your Azure Database for MySQL flexible server instance from the list of entities.

Limitations

When monitoring an Azure Database for MySQL - Flexible Server instance, some features behave differently than on self-managed MySQL, due to Azure platform restrictions rather than anything in the receiver.

Granting BACKUP_ADMIN isn't supported, which blocks mysql.innodb.redo_log.checkpoint.age, mysql.innodb.redo_log.lsn.checkpoint, and mysql.innodb.redo_log.lsn.current entirely.

The MySQL X Plugin isn't supported on this platform, with no customer-enable path, confirmed by Microsoft's Azure Database for MySQL Principal PM. As a result, mysql.mysqlx_connections and mysql.mysqlx_worker_threads report no data.

Read replicas use storage-based replication, so mysql.replica.thread.running always reports not running regardless of actual replication health. mysql.replica.time_behind_source is unaffected.

Instrumentation in self-hosted environments

Learn how to set up MySQL monitoring in self-hosted environments with New Relic.

AWS RDS setup

Learn how to set up MySQL monitoring for AWS RDS with New Relic.

Metrics reference

Learn about the available metrics collected by the NRDOT Collector.

Troubleshooting guide

Learn how to troubleshoot common issues with MySQL monitoring.

Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.