You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/component/database_observability/README.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,19 +13,24 @@
13
13
```sql
14
14
CREATE USER 'db-o11y'@'%' IDENTIFIED by '<password>';
15
15
GRANT PROCESS, REPLICATION CLIENT ON*.* TO 'db-o11y'@'%';
16
-
GRANTSELECT, SHOW VIEW ON*.* TO 'db-o11y'@'%';/* see note */
16
+
GRANTSELECTONperformance_schema.* TO 'db-o11y'@'%';
17
17
```
18
18
19
-
Please note: Regarding `GRANT SELECT, SHOW VIEW ON *.* TO 'db-o11y'@'%'`, it is possible to restrict permissions, if necessary. Instead, grant the `db-o11y` user privileges access only to the objects (schemas) for which you want information. For example, to restrict permissions only to a schema named `payments`:
19
+
3. Grant the `db-o11y` user additional privileges to access the objects (schemas, tables, views) for which you want to collect detailed information.
20
+
21
+
For example, to limit permissions only to a schema named `payments`:
20
22
21
23
```sql
22
-
CREATE USER 'db-o11y'@'%' IDENTIFIED by '<password>';
23
-
GRANT PROCESS, REPLICATION CLIENT ON*.* TO 'db-o11y'@'%';
24
-
GRANTSELECTON performance_schema.* TO 'db-o11y'@'%'; /* required */
25
-
GRANTSELECT, SHOW VIEW ON payments.* TO 'db-o11y'@'%'; /* limit grant to the `payments` schema */
24
+
GRANTSELECT, SHOW VIEW ON payments.* TO 'db-o11y'@'%';
25
+
```
26
+
27
+
Alternatively, grant access to all available schemas:
28
+
29
+
```sql
30
+
GRANTSELECT, SHOW VIEW ON*.* TO 'db-o11y'@'%';
26
31
```
27
32
28
-
3. Verify that the user has been properly created.
33
+
4. Verify that the user has been properly created.
4. Enable Performance Schema. To enable it explicitly, start the server with the `performance_schema` variable set to an appropriate value. Verify that Performance Schema has been enabled:
46
+
5. Enable Performance Schema. To enable it explicitly, start the server with the `performance_schema` variable set to an appropriate value. Verify that Performance Schema has been enabled:
42
47
43
48
```sql
44
49
SHOW VARIABLES LIKE'performance_schema';
@@ -50,7 +55,7 @@ SHOW VARIABLES LIKE 'performance_schema';
50
55
+--------------------+-------+
51
56
```
52
57
53
-
5. Increase `max_digest_length` and `performance_schema_max_digest_length` to `4096`. Verify that the changes have been applied:
58
+
6. Increase `max_digest_length` and `performance_schema_max_digest_length` to `4096`. Verify that the changes have been applied:
54
59
55
60
```sql
56
61
SHOW VARIABLES LIKE'max_digest_length';
@@ -74,7 +79,7 @@ SHOW VARIABLES LIKE 'performance_schema_max_digest_length';
74
79
+--------------------------------------+-------+
75
80
```
76
81
77
-
6.[OPTIONAL] Increase `performance_schema_max_sql_text_length` to `4096` if you want to collect the actual, unredacted sql text from queries samples (this requires setting `disable_query_redaction` to `true`, see later). Verify that the changes have been applied:
82
+
7.[OPTIONAL] Increase `performance_schema_max_sql_text_length` to `4096` if you want to collect the actual, unredacted sql text from queries samples (this requires setting `disable_query_redaction` to `true`, see later). Verify that the changes have been applied:
78
83
79
84
```sql
80
85
SHOW VARIABLES LIKE'performance_schema_max_sql_text_length';
@@ -86,7 +91,7 @@ SHOW VARIABLES LIKE 'performance_schema_max_sql_text_length';
7.[OPTIONAL] Enable the `events_statements_cpu` consumer if you want to capture CPU activity and time on query samples. Verify the current setting with a sql query:
94
+
8.[OPTIONAL] Enable the `events_statements_cpu` consumer if you want to capture CPU activity and time on query samples. Verify the current setting with a sql query:
90
95
91
96
```sql
92
97
SELECT*FROMperformance_schema.setup_consumersWHERE NAME ='events_statements_cpu';
8.[OPTIONAL] Enable the `events_waits_current` and `events_waits_history` consumers if you want to collect wait events for each query sample. Verify the current settings with a sql query:
129
+
9.[OPTIONAL] Enable the `events_waits_current` and `events_waits_history` consumers if you want to collect wait events for each query sample. Verify the current settings with a sql query:
125
130
126
131
```sql
127
132
SELECT*FROMperformance_schema.setup_consumersWHERE NAME IN ('events_waits_current', 'events_waits_history');
0 commit comments