Skip to content

Commit 04ddeca

Browse files
committed
Adding the error.* domains
Adding the `metrics/error` package that includes the following domains: - `error.global` - `error.account` - `error.host` - `error.thread` - `error.user` These domains emit metrics on errors from the error summary tables (https://dev.mysql.com/doc/refman/en/performance-schema-error-summary-tables.html) See the documentation for more details.
1 parent 8aeab25 commit 04ddeca

File tree

21 files changed

+2852
-13
lines changed

21 files changed

+2852
-13
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: "error.account"
3+
---
4+
5+
The `error.account` domain includes server error metrics grouped by account from [error summary tables](https://dev.mysql.com/doc/refman/en/performance-schema-error-summary-tables.html).
6+
7+
{{< toc >}}
8+
9+
## Usage
10+
11+
For example:
12+
13+
```
14+
mysql> SELECT * FROM performance_schema.events_errors_summary_by_account_by_error WHERE error_number = 3024 AND USER IN ('user')\G
15+
*************************** 1. row ***************************
16+
USER: user
17+
HOST: localhost
18+
ERROR_NUMBER: 3024
19+
ERROR_NAME: ER_QUERY_TIMEOUT
20+
SQL_STATE: HY000
21+
SUM_ERROR_RAISED: 1
22+
SUM_ERROR_HANDLED: 0
23+
FIRST_SEEN: 2025-04-30 16:30:16
24+
LAST_SEEN: 2025-04-30 16:30:16
25+
```
26+
27+
The `SUM_ERR_RAISED` value is used for the Blip `raised` metric. `ERROR_NUMBER`, `ERROR_NAME`, `USER`, and `HOST` are used to group the metric.
28+
29+
## Derived Metrics
30+
31+
None.
32+
33+
## Options
34+
35+
### `all`
36+
37+
|Value|Default|Description|
38+
|-----|-------|-----------|
39+
|yes |&check; |Collect metrics on _all_ errors (not recommended)|
40+
|no | |Collect only metrics for the errors listed in the plan|
41+
|exclude| |Collect metrics only for errors that are not listed in the plan|
42+
43+
### `total`
44+
45+
|Value|Default|Description|
46+
|-----|-------|-----------|
47+
|yes |&check; |Return the total number of errors raised|
48+
|no | |Do not return the total number of errors raised|
49+
|only| |Only return the total number of errors raised|
50+
51+
If `all` is not set to `yes` the total will only reflect those errors that are specifically included or not excluded from collection.
52+
53+
### `include`
54+
55+
| | |
56+
|---|---|
57+
|**Value Type**|CSV string of accounts|
58+
|**Default**||
59+
60+
A comma-separated list of ids to include. Overrides option `exclude`. The values for the filter should be formatted as `user@hostname`. Wildcards are allowed for either `user` or `hostname`, but not both. Invalid values will be ignored.
61+
62+
### `exclude`
63+
64+
| | |
65+
|---|---|
66+
|**Value Type**|CSV string of accounts|
67+
|**Default**||
68+
69+
A comma-separated list of ids to exclude. Ignored if `include` is set. The values for the filter should be formatted as `user@hostname`. Wildcards are allowed for either `user` or `hostname`, but not both. Invalid values will be ignored.
70+
71+
### `truncate-table`
72+
73+
|Value|Default|Description|
74+
|---|---|---|
75+
|yes| |Truncate table after each successful collection|
76+
|no|&check; |Do not truncate table|
77+
78+
If the table is truncated (default), the metrics are delta counters.
79+
Else, the values are cumulative counters.
80+
81+
### `truncate-timeout`
82+
83+
| | |
84+
|---|---|
85+
|**Value Type**|[Duration string](https://pkg.go.dev/time#ParseDuration)|250ms|
86+
|**Default**|250ms|
87+
88+
Sets `@@session.lock_wait_timeout` to avoid waiting too long when truncating the table.
89+
Normally, truncating a table is nearly instantaneous, but metadata locks can block the operation.
90+
91+
### `truncate-on-startup`
92+
93+
|Value|Default|Description|
94+
|---|---|---|
95+
|yes|&check;|Truncate source table on start of metric collection|
96+
|no| |Do not truncate source table on startup|
97+
98+
Truncates the source table when Blip starts. The timeout use will be the same as specified by `truncate-timeout`.
99+
100+
## Group Keys
101+
102+
|Key|Value|
103+
|---|---|
104+
|`error_nunmber`|The error number or an empty string for a total|
105+
|`error_name`|The short error name or an empty string for a total|
106+
|`error_user`|The user name for the error|
107+
|`error_host`|The host for the error|
108+
109+
## Meta
110+
111+
None.
112+
113+
## Error Policies
114+
115+
|Name|MySQL Error|
116+
|----|-----------|
117+
|`truncate-timeout`|Error truncating table|
118+
119+
## MySQL Config
120+
121+
See
122+
* [29.12.20.11 Error Summary Tables](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-error-summary-tables.html)
123+
124+
and related pages in the MySQL manual.
125+
126+
## Changelog
127+
128+
|Blip Version|Change|
129+
|------------|------|
130+
|TBD |Domain added|
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: "error.global"
3+
---
4+
5+
The `error.global` domain includes global server error metrics from [error summary tables](https://dev.mysql.com/doc/refman/en/performance-schema-error-summary-tables.html).
6+
7+
{{< toc >}}
8+
9+
## Usage
10+
11+
For example:
12+
13+
```
14+
mysql> SELECT * FROM performance_schema.events_errors_summary_global_by_error WHERE error_number = 3024\G
15+
*************************** 1. row ***************************
16+
ERROR_NUMBER: 3024
17+
ERROR_NAME: ER_QUERY_TIMEOUT
18+
SQL_STATE: HY000
19+
SUM_ERROR_RAISED: 1
20+
SUM_ERROR_HANDLED: 0
21+
FIRST_SEEN: 2025-04-30 16:30:16
22+
LAST_SEEN: 2025-04-30 16:30:16
23+
```
24+
25+
The `SUM_ERR_RAISED` value is used for the Blip `raised` metric. `ERROR_NUMBER` and `ERROR_NAME` are used to group the metric.
26+
27+
## Derived Metrics
28+
29+
None.
30+
31+
## Options
32+
33+
### `all`
34+
35+
|Value|Default|Description|
36+
|-----|-------|-----------|
37+
|yes |&check; |Collect metrics on _all_ errors (not recommended)|
38+
|no | |Collect only metrics for the errors listed in the plan|
39+
|exclude| |Collect metrics only for errors that are not listed in the plan|
40+
41+
### `total`
42+
43+
|Value|Default|Description|
44+
|-----|-------|-----------|
45+
|yes |&check; |Return the total number of errors raised|
46+
|no | |Do not return the total number of errors raised|
47+
|only| |Only return the total number of errors raised|
48+
49+
If `all` is not set to `yes` the total will only reflect those errors that are specifically included or not excluded from collection.
50+
51+
### `truncate-table`
52+
53+
|Value|Default|Description|
54+
|---|---|---|
55+
|yes| |Truncate table after each successful collection|
56+
|no|&check; |Do not truncate table|
57+
58+
If the table is truncated (default), the metrics are delta counters.
59+
Else, the values are cumulative counters.
60+
61+
### `truncate-timeout`
62+
63+
| | |
64+
|---|---|
65+
|**Value Type**|[Duration string](https://pkg.go.dev/time#ParseDuration)|250ms|
66+
|**Default**|250ms|
67+
68+
Sets `@@session.lock_wait_timeout` to avoid waiting too long when truncating the table.
69+
Normally, truncating a table is nearly instantaneous, but metadata locks can block the operation.
70+
71+
### `truncate-on-startup`
72+
73+
|Value|Default|Description|
74+
|---|---|---|
75+
|yes|&check;|Truncate source table on start of metric collection|
76+
|no| |Do not truncate source table on startup|
77+
78+
Truncates the source table when Blip starts. The timeout use will be the same as specified by `truncate-timeout`.
79+
80+
## Group Keys
81+
82+
|Key|Value|
83+
|---|---|
84+
|`error_nunmber`|The error number or an empty string for a total|
85+
|`error_name`|The short error name or an empty string for a total|
86+
87+
## Meta
88+
89+
None.
90+
91+
## Error Policies
92+
93+
|Name|MySQL Error|
94+
|----|-----------|
95+
|`truncate-timeout`|Error truncating table|
96+
97+
## MySQL Config
98+
99+
See
100+
* [29.12.20.11 Error Summary Tables](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-error-summary-tables.html)
101+
102+
and related pages in the MySQL manual.
103+
104+
## Changelog
105+
106+
|Blip Version|Change|
107+
|------------|------|
108+
|TBD |Domain added|
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
title: "error.host"
3+
---
4+
5+
The `error.host` domain includes server error metrics grouped by host from [error summary tables](https://dev.mysql.com/doc/refman/en/performance-schema-error-summary-tables.html).
6+
7+
{{< toc >}}
8+
9+
## Usage
10+
11+
For example:
12+
13+
```
14+
mysql> SELECT * FROM performance_schema.events_errors_summary_by_host_by_error WHERE error_number = 3024 AND HOST IN ('host1')\G
15+
*************************** 1. row ***************************
16+
HOST: host1
17+
ERROR_NUMBER: 3024
18+
ERROR_NAME: ER_QUERY_TIMEOUT
19+
SQL_STATE: HY000
20+
SUM_ERROR_RAISED: 1
21+
SUM_ERROR_HANDLED: 0
22+
FIRST_SEEN: 2025-04-30 16:30:16
23+
LAST_SEEN: 2025-04-30 16:30:16
24+
```
25+
26+
The `SUM_ERR_RAISED` value is used for the Blip `raised` metric. `ERROR_NUMBER`, `ERROR_NAME`, and `HOST` are used to group the metric.
27+
28+
## Derived Metrics
29+
30+
None.
31+
32+
## Options
33+
34+
### `all`
35+
36+
|Value|Default|Description|
37+
|-----|-------|-----------|
38+
|yes |&check; |Collect metrics on _all_ errors (not recommended)|
39+
|no | |Collect only metrics for the errors listed in the plan|
40+
|exclude| |Collect metrics only for errors that are not listed in the plan|
41+
42+
### `total`
43+
44+
|Value|Default|Description|
45+
|-----|-------|-----------|
46+
|yes |&check; |Return the total number of errors raised|
47+
|no | |Do not return the total number of errors raised|
48+
|only| |Only return the total number of errors raised|
49+
50+
If `all` is not set to `yes` the total will only reflect those errors that are specifically included or not excluded from collection.
51+
52+
### `include`
53+
54+
| | |
55+
|---|---|
56+
|**Value Type**|CSV string of hosts|
57+
|**Default**||
58+
59+
A comma-separated list of hosts to include. Overrides option `exclude`.
60+
61+
### `exclude`
62+
63+
| | |
64+
|---|---|
65+
|**Value Type**|CSV string of hosts|
66+
|**Default**||
67+
68+
A comma-separated list of hosts to exclude. Ignored if `include` is set.
69+
70+
### `truncate-table`
71+
72+
|Value|Default|Description|
73+
|---|---|---|
74+
|yes| |Truncate table after each successful collection|
75+
|no|&check; |Do not truncate table|
76+
77+
If the table is truncated (default), the metrics are delta counters.
78+
Else, the values are cumulative counters.
79+
80+
### `truncate-timeout`
81+
82+
| | |
83+
|---|---|
84+
|**Value Type**|[Duration string](https://pkg.go.dev/time#ParseDuration)|250ms|
85+
|**Default**|250ms|
86+
87+
Sets `@@session.lock_wait_timeout` to avoid waiting too long when truncating the table.
88+
Normally, truncating a table is nearly instantaneous, but metadata locks can block the operation.
89+
90+
### `truncate-on-startup`
91+
92+
|Value|Default|Description|
93+
|---|---|---|
94+
|yes|&check;|Truncate source table on start of metric collection|
95+
|no| |Do not truncate source table on startup|
96+
97+
Truncates the source table when Blip starts. The timeout use will be the same as specified by `truncate-timeout`.
98+
99+
## Group Keys
100+
101+
|Key|Value|
102+
|---|---|
103+
|`error_nunmber`|The error number or an empty string for a total|
104+
|`error_name`|The short error name or an empty string for a total|
105+
|`error_host`|The host for the error|
106+
107+
## Meta
108+
109+
None.
110+
111+
## Error Policies
112+
113+
|Name|MySQL Error|
114+
|----|-----------|
115+
|`truncate-timeout`|Error truncating table|
116+
117+
## MySQL Config
118+
119+
See
120+
* [29.12.20.11 Error Summary Tables](https://dev.mysql.com/doc/refman/8.4/en/performance-schema-error-summary-tables.html)
121+
122+
and related pages in the MySQL manual.
123+
124+
## Changelog
125+
126+
|Blip Version|Change|
127+
|------------|------|
128+
|TBD |Domain added|

0 commit comments

Comments
 (0)