Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 336 additions & 8 deletions src/install/config/mysql.yaml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/install/mysql/appInfo_activation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
componentType: appInfoConfigOption
optionType: activation_method
headingText: Select Method of Activation for Performance Schema Consumers and Instruments
---
36 changes: 36 additions & 0 deletions src/install/mysql/aurora/enable-mysql-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
componentType: default
headingText: Enable your MySQL Server
---

To capture data from the MySQL integration, you must first create a MySQL user with the necessary permissions for integration to fetch metrics:

* [REPLICATION CLIENT](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_replication-client)
* [SELECT](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_select)
* [PROCESS](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_process)

**To create a user and provide permissions:**

1. To create a user `newrelic@AWS-or-Azure-instance-name` with a specific password, run the following command:
```shell
mysql -e "CREATE USER 'newrelic'@'AWS-or-Azure-instance-name' IDENTIFIED BY $YOUR_PASSWORD WITH MAX_USER_CONNECTIONS 5;"
```

2. To grant replication privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT REPLICATION CLIENT ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

3. To grant select privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT SELECT ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

4. To grant process privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT PROCESS ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

<callout variant="tip" title="Tip">
Each command sets a maximum of 5 user connections.
</callout>
30 changes: 30 additions & 0 deletions src/install/mysql/aurora/stored-procedure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. Create the following schema
<Callout variant="tip">
Create a dedicated schema for the New Relic monitoring user. This schema will be used by the integration to store procedures needed for query performance monitoring.
</Callout>
```sql
CREATE SCHEMA IF NOT EXISTS newrelic;
GRANT EXECUTE ON newrelic.* TO 'newrelic'@'AWS-or-Azure-instance-name';
```
2. Set Up Procedure for Runtime Activation of Consumers and Instruments
<Callout variant="tip">
Newrelic recommends that you create the following procedure to grant the Agent the ability to enable performance_schema.events_* `consumers` and `instruments` at runtime.
</Callout>
<>&nbsp;</>
```sql
DELIMITER $$
CREATE PROCEDURE newrelic.enable_essential_consumers_and_instruments()
SQL SECURITY DEFINER
BEGIN
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';
END $$
DELIMITER ;
GRANT EXECUTE ON PROCEDURE newrelic.enable_essential_consumers_and_instruments TO 'newrelic'@'AWS-or-Azure-instance-name';
```
31 changes: 31 additions & 0 deletions src/install/mysql/aurora/update-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
componentType: default
headingText: Enable MySQL query-level monitoring
---

Configure your integration to enable query-level monitoring in New Relic. By setting the appropriate parameters, you can capture detailed metrics on query performance, which allows you to identify and optimize slow or inefficient queries. For more information, refer [Query-Level monitoring](/docs/infrastructure/infrastructure-data/query-level-monitoring).

Follow these instructions to enable Performance Schema for Aurora MySQL.

Enable Performance Schema by creating or modifying a DB Parameter Group and associating it with your Aurora DB instance. Follow these steps:

1. Navigate to the RDS service in the AWS Management Console.
2. Select `Parameter groups` and either:
* Create two new DB Parameter Groups: one for the Aurora cluster and another for the Aurora instance, with a family matching your Aurora MySQL version (e.g., `aurora-mysql8.0`).
* Modify existing custom DB Parameter Groups already associated with your Aurora DB setup. Do not modify the default parameter group.
3. Configure the DB Parameter Groups by setting the following consumer parameters:
```ini
performance_schema = 1
performance_schema_consumer_events_statements_current = 1
performance_schema_consumer_events_statements_history = 1
performance_schema_consumer_events_statements_history_long = 1
performance_schema_consumer_events_waits_history = 1
performance_schema_consumer_events_waits_history_long = 1
performance-schema-consumer-events-waits-current = ON
performance_schema_max_digest_length = 4096
performance_schema_max_sql_text_length = 4096
```
4. Associate the modified or newly created DB Parameter Groups with your Aurora DB cluster and instance. (Select your DB cluster and instance in the RDS console, click `Modify`, and find the `DB instance parameter group` and `DB cluster parameter group` settings.)
5. Reboot your Aurora DB instance for the changes to take effect.

Refer to the `Working with DB Parameter Groups` section of the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_WorkingWithParamGroups.html).
14 changes: 14 additions & 0 deletions src/install/mysql/aurora/update-privileges.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. <Callout variant="tip">
Grants the monitoring user direct UPDATE privileges on `performance_schema.setup_consumers` and `performance_schema.setup_instruments` tables. This allows the New Relic agent to manage required Performance Schema settings directly.
</Callout>
<>&nbsp;</>
```sql
GRANT UPDATE ON performance_schema.setup_consumers TO 'newrelic'@'AWS-or-Azure-instance-name';
GRANT UPDATE ON performance_schema.setup_instruments TO 'newrelic'@'AWS-or-Azure-instance-name';
```
30 changes: 30 additions & 0 deletions src/install/mysql/linux/stored-procedure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. Create the following schema
<Callout variant="tip">
Create a dedicated schema for the New Relic monitoring user. This schema will be used by the integration to store procedures needed for query performance monitoring.
</Callout>
```sql
CREATE SCHEMA IF NOT EXISTS newrelic;
GRANT EXECUTE ON newrelic.* TO 'newrelic'@'localhost';
```
2. Set Up Procedure for Runtime Activation of Consumers and Instruments
<Callout variant="tip">
Newrelic recommends that you create the following procedure to grant the Agent the ability to enable performance_schema.events_* `consumers` and `instruments` at runtime.
</Callout>
<>&nbsp;</>
```sql
DELIMITER $$
CREATE PROCEDURE newrelic.enable_essential_consumers_and_instruments()
SQL SECURITY DEFINER
BEGIN
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';
END $$
DELIMITER ;
GRANT EXECUTE ON PROCEDURE newrelic.enable_essential_consumers_and_instruments TO 'newrelic'@'localhost';
```
20 changes: 7 additions & 13 deletions src/install/mysql/linux/update-config-apt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ Query-level monitoring is supported only on MySQL version 8.0 and later.
1. Open the MySQL configuration file available at either `/etc/mysql/mysql.conf.d/mysqld.cnf` or `/etc/mysql/my.cnf`, then add the following lines to the configuration file:
```ini
[mysqld]
performance_schema=ON
performance_schema=ON
max_digest_length = 4096
performance_schema_max_digest_length = 4096
performance_schema_max_sql_text_length = 4096

# Specify an initialization file for Debian/Ubuntu
init-file = /etc/mysql/init.sql
# Specify an initialization file for Debian/Ubuntu
init-file = /etc/mysql/init.sql
```
2. In the `/etc/mysql/` directory, create a `init.sql` file with the following content:
```sql
Expand All @@ -25,16 +28,7 @@ Query-level monitoring is supported only on MySQL version 8.0 and later.
SET ENABLED = 'YES', TIMED = 'YES'
WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';

UPDATE performance_schema.setup_consumers
SET ENABLED = 'YES'
WHERE NAME IN (
'events_waits_current', 'events_waits_history_long',
'events_waits_history',
'events_statements_history_long',
'events_statements_history', 'events_statements_current',
'events_statements_cpu'
) OR NAME LIKE 'events_waits_current%' OR NAME LIKE 'events_transactions_current%'
OR NAME LIKE 'events_stages_current%';
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';

-- Increase Innodb lock wait timeout
SET GLOBAL innodb_lock_wait_timeout = 120;
Expand Down
20 changes: 7 additions & 13 deletions src/install/mysql/linux/update-config-yum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ Query-level monitoring is supported only on MySQL version 8.0 and later.
1. Open the MySQL configuration file available at either `/etc/my.cnf.d/mysql-server.cnf` or `/etc/my.cnf`:
```ini
[mysqld]
performance_schema=ON
performance_schema=ON
max_digest_length = 4096
performance_schema_max_digest_length = 4096
performance_schema_max_sql_text_length = 4096

# Specify an initialization file for RHEL/CentOS/Amazon Linux/Oracle Linux
init-file = /etc/init.sql
# Specify an initialization file for RHEL/CentOS/Amazon Linux/Oracle Linux
init-file = /etc/init.sql
```
2. In the `/etc/` directory, create a `init.sql` file with the following content:
```sql
Expand All @@ -25,16 +28,7 @@ Query-level monitoring is supported only on MySQL version 8.0 and later.
SET ENABLED = 'YES', TIMED = 'YES'
WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';

UPDATE performance_schema.setup_consumers
SET ENABLED = 'YES'
WHERE NAME IN (
'events_waits_current', 'events_waits_history_long',
'events_waits_history',
'events_statements_history_long',
'events_statements_history', 'events_statements_current',
'events_statements_cpu'
) OR NAME LIKE 'events_waits_current%' OR NAME LIKE 'events_transactions_current%'
OR NAME LIKE 'events_stages_current%';
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';

-- Increase Innodb lock wait timeout
SET GLOBAL innodb_lock_wait_timeout = 120;
Expand Down
14 changes: 14 additions & 0 deletions src/install/mysql/linux/update-privileges.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. <Callout variant="tip">
Grants the monitoring user direct UPDATE privileges on `performance_schema.setup_consumers` and `performance_schema.setup_instruments` tables. This allows the New Relic agent to manage required Performance Schema settings directly.
</Callout>
<>&nbsp;</>
```sql
GRANT UPDATE ON performance_schema.setup_consumers TO 'newrelic'@'localhost';
GRANT UPDATE ON performance_schema.setup_instruments TO 'newrelic'@'localhost';
```
36 changes: 36 additions & 0 deletions src/install/mysql/rds/enable-mysql-server.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
componentType: default
headingText: Enable your MySQL Server
---

To capture data from the MySQL integration, you must first create a MySQL user with the necessary permissions for integration to fetch metrics:

* [REPLICATION CLIENT](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_replication-client)
* [SELECT](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_select)
* [PROCESS](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_process)

**To create a user and provide permissions:**

1. To create a user `newrelic@AWS-or-Azure-instance-name` with a specific password, run the following command:
```shell
mysql -e "CREATE USER 'newrelic'@'AWS-or-Azure-instance-name' IDENTIFIED BY $YOUR_PASSWORD WITH MAX_USER_CONNECTIONS 5;"
```

2. To grant replication privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT REPLICATION CLIENT ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

3. To grant select privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT SELECT ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

4. To grant process privileges to `newrelic@AWS-or-Azure-instance-name`, run the following command:
```shell
mysql -e "GRANT PROCESS ON *.* TO 'newrelic'@'AWS-or-Azure-instance-name' WITH MAX_USER_CONNECTIONS 5;"
```

<callout variant="tip" title="Tip">
Each command sets a maximum of 5 user connections.
</callout>
30 changes: 30 additions & 0 deletions src/install/mysql/rds/stored-procedure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. Create the following schema
<Callout variant="tip">
Create a dedicated schema for the New Relic monitoring user. This schema will be used by the integration to store procedures needed for query performance monitoring.
</Callout>
```sql
CREATE SCHEMA IF NOT EXISTS newrelic;
GRANT EXECUTE ON newrelic.* TO 'newrelic'@'AWS-or-Azure-instance-name';
```
2. Set Up Procedure for Runtime Activation of Consumers and Instruments
<Callout variant="tip">
Newrelic recommends that you create the following procedure to grant the Agent the ability to enable performance_schema.events_* `consumers` and `instruments` at runtime.
</Callout>
<>&nbsp;</>
```sql
DELIMITER $$
CREATE PROCEDURE newrelic.enable_essential_consumers_and_instruments()
SQL SECURITY DEFINER
BEGIN
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';
END $$
DELIMITER ;
GRANT EXECUTE ON PROCEDURE newrelic.enable_essential_consumers_and_instruments TO 'newrelic'@'AWS-or-Azure-instance-name';
```
26 changes: 26 additions & 0 deletions src/install/mysql/rds/update-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
componentType: default
headingText: Enable MySQL query-level monitoring
---

Configure your integration to enable query-level monitoring in New Relic. By setting the appropriate parameters, you can capture detailed metrics on query performance, which allows you to identify and optimize slow or inefficient queries. For more information, refer [Query-Level monitoring](/docs/infrastructure/infrastructure-data/query-level-monitoring).

Follow these instructions to enable the Performance Schema. The configuration method outlined here applies specifically to MySQL RDS.

Enable Performance Schema by creating or modifying a DB Parameter Group and associating it with your MySQL RDS DB instance. Follow these steps:

1. Navigate to the RDS service in the AWS Management Console.
2. Select `Parameter groups` and either:
* Create a new DB Parameter Group with a family that matches your MySQL version (e.g., `mysql8.0`).
* Modify existing custom DB Parameter Groups already associated with your RDS DB instance. Do not modify the default parameter group.
3. Configure the DB Parameter Groups by setting the following consumer parameters:
```ini
performance_schema = 1
max_digest_length = 4096
performance_schema_max_digest_length = 4096
performance_schema_max_sql_text_length = 4096
```
4. Associate the modified or newly created DB Parameter Groups with your RDS DB cluster and instance. (Select your DB cluster and instance in the RDS console, click `Modify`, and find the `DB instance parameter group` and `DB cluster parameter group` settings.)
5. Reboot your MySQL RDS DB instance for the changes to take effect.

Refer to the `Working with DB Parameter Groups` section of the [AWS documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html).
14 changes: 14 additions & 0 deletions src/install/mysql/rds/update-privileges.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. <Callout variant="tip">
Grants the monitoring user direct UPDATE privileges on `performance_schema.setup_consumers` and `performance_schema.setup_instruments` tables. This allows the New Relic agent to manage required Performance Schema settings directly.
</Callout>
<>&nbsp;</>
```sql
GRANT UPDATE ON performance_schema.setup_consumers TO 'newrelic'@'AWS-or-Azure-instance-name';
GRANT UPDATE ON performance_schema.setup_instruments TO 'newrelic'@'AWS-or-Azure-instance-name';
```
30 changes: 30 additions & 0 deletions src/install/mysql/windows/stored-procedure.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
componentType: default
headingText: Enable Performance Schema Concumers and Instruments
---


1. Create the following schema
<Callout variant="tip">
Create a dedicated schema for the New Relic monitoring user. This schema will be used by the integration to store procedures needed for query performance monitoring.
</Callout>
```sql
CREATE SCHEMA IF NOT EXISTS newrelic;
GRANT EXECUTE ON newrelic.* TO 'newrelic'@'localhost';
```
2. Set Up Procedure for Runtime Activation of Consumers and Instruments
<Callout variant="tip">
Newrelic recommends that you create the following procedure to grant the Agent the ability to enable performance_schema.events_* `consumers` and `instruments` at runtime.
</Callout>
<>&nbsp;</>
```sql
DELIMITER $$
CREATE PROCEDURE newrelic.enable_essential_consumers_and_instruments()
SQL SECURITY DEFINER
BEGIN
UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%' OR name LIKE 'events_waits_%';
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'wait/%' OR NAME LIKE 'statement/%' OR NAME LIKE '%lock%';
END $$
DELIMITER ;
GRANT EXECUTE ON PROCEDURE newrelic.enable_essential_consumers_and_instruments TO 'newrelic'@'localhost';
```
Loading