forked from GoogleCloudPlatform/ops-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata.yaml
More file actions
389 lines (387 loc) · 15.9 KB
/
metadata.yaml
File metadata and controls
389 lines (387 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
public_url: "https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/third-party/mysql"
app_url: "http://www.mysql.com/"
short_name: MySQL
long_name: MySQL
logo_path: /images/launcher/logos/mysql.png # supplied by google technical writer
description: |-
The MySQL/MariaDB integration collects performance metrics related to
InnoDB, the buffer pool, and various other operations. It also collects general,
error, and slow-query logs and parses them into a JSON payload. Error logs are
parsed for their error code and subsystem. Slow-query logs are parsed into
key-value pairs that describe the performance of a query, including query time
and rows examined.
configure_integration: |-
MariaDB is a community-developed, commercially supported fork of the MySQL
relational database management system (RDBMS). To collect logs and metrics for
MariaDB, use the `mysql` receivers.
The `mysql` receiver connects by default to a local MySQL/MariaDB
server using a Unix socket and Unix authentication as the `root` user.
minimum_supported_agent_version:
metrics: 2.33.0
logging: 2.33.0
supported_operating_systems: linux
platforms_to_skip:
# MySQL5.7 is not supported on various distros.
- suse-cloud:sles-12
- suse-cloud:sles-15
- suse-cloud:sles-15-arm64
- suse-sap-cloud:sles-12-sp5-sap
- rocky-linux-cloud:rocky-linux-8
- rocky-linux-cloud:rocky-linux-8-optimized-gcp
- rocky-linux-cloud:rocky-linux-8-optimized-gcp-arm64
- rocky-linux-cloud:rocky-linux-9
- rocky-linux-cloud:rocky-linux-9-optimized-gcp
- rocky-linux-cloud:rocky-linux-9-arm64
- rocky-linux-cloud:rocky-linux-9-optimized-gcp-arm64
- debian-cloud:debian-11
- debian-cloud:debian-12
- debian-cloud:debian-12-arm64
- ml-images:common-gpu-debian-11-py310
- ubuntu-os-cloud:ubuntu-2004-lts
- ubuntu-os-cloud:ubuntu-2004-lts-arm64
- ubuntu-os-cloud:ubuntu-2204-lts
- ubuntu-os-cloud:ubuntu-2204-lts-arm64
- ubuntu-os-cloud:ubuntu-2404-lts-amd64
- ubuntu-os-cloud:ubuntu-2404-lts-arm64
- ubuntu-os-cloud:ubuntu-2410-amd64
- ubuntu-os-cloud:ubuntu-minimal-2410-amd64
- ubuntu-os-cloud:ubuntu-2410-arm64
- ubuntu-os-cloud:ubuntu-minimal-2410-arm64
- ubuntu-os-cloud:ubuntu-2504-lts-amd64
- ubuntu-os-cloud:ubuntu-2504-lts-arm64
supported_app_version: ["5.7", "8.0"]
expected_metrics:
- type: workload.googleapis.com/mysql.buffer_pool_data_pages
value_type: INT64
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: status
value_regex: dirty|clean
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.buffer_pool_limit
value_type: INT64
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.buffer_pool_operations
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: operation
value_regex: read_ahead|read_ahead_evicted|read_ahead_rnd|read_requests|reads|wait_free|write_requests
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.buffer_pool_page_flushes
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.buffer_pool_pages
value_type: DOUBLE
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: data|free|misc
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.buffer_pool_size
value_type: DOUBLE
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: clean|dirty
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.commands
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: command
value_regex: delete|insert|select|update
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.double_writes
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: writes|pages_written
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.handlers
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: commit|delete|discover|lock|mrr_init|prepare|read_first|read_key|read_last|read_next|read_prev|read_rnd|read_rnd_next|rollback|savepoint|savepoint_rollback|update|write
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.locks
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: immediate|waited
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.log_operations
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: operation
value_regex: requests|waits|writes
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.operations
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: operation
value_regex: fsyncs|reads|writes
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.page_operations
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: operation
value_regex: created|read|written
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.replica.time_behind_source
value_type: INT64
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.replica.sql_delay
value_type: INT64
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.row_locks
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: time|waits
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.row_operations
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: operation
value_regex: deleted|inserted|read|updated
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.sorts
value_type: INT64
kind: CUMULATIVE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: merge_passes|range|rows|scan
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
- type: workload.googleapis.com/mysql.threads
value_type: DOUBLE
kind: GAUGE
monitored_resources: [gce_instance]
labels:
- name: kind
value_regex: cached|connected|created|running
- name: instrumentation_source
value_regex: agent.googleapis.com/mysql
representative: true
expected_logs:
# Mysql 5.7 error logs go to syslog by default
# - log_name: mysql_error
# fields:
# - name: jsonPayload.level
# value_regex: System
# type: string
# description: 'Log entry level'
# optional: true
# - name: jsonPayload.message
# value_regex: .*InnoDB initialization has started.*
# type: string
# description: 'Log message'
# - name: jsonPayload.subsystem
# value_regex: InnoDB
# type: string
# description: 'MySQL subsystem where the log originated'
# - name: jsonPayload.tid
# type: number
# description: 'Thread ID where the log originated'
# - name: jsonPayload.errorCode
# type: string
# description: 'MySQL error code associated with the log'
# - name: severity
# type: string
# description: ''
- log_name: mysql_general
fields:
- name: jsonPayload.message
value_regex: .*select table_catalog, table_schema, table_name from information_schema.tables.*
type: string
description: 'Log of the database action'
- name: jsonPayload.command
value_regex: Query
type: string
description: 'Type of database action being logged'
- name: jsonPayload.tid
type: number
description: 'Thread ID where the log originated'
- name: severity
type: string
description: ''
- log_name: mysql_slow
fields:
- name: jsonPayload.message
value_regex: (?s).*select table_catalog, table_schema, table_name from information_schema.tables.* # The (?s) part will make the . match with newline as well. See https://github.com/google/re2/blob/main/doc/syntax.txt#L65,L68
type: string
description: 'Full text of the query'
- name: jsonPayload.user
value_regex: root
type: string
description: 'User that executed the query'
- name: jsonPayload.database
value_regex: root
type: string
description: 'Database where the query was executed'
- name: jsonPayload.host
value_regex: localhost
type: string
description: 'Host of the database instance'
- name: jsonPayload.ipAddress
type: string
description: 'Address of the database instance'
optional: true
- name: jsonPayload.tid
type: number
description: 'Thread ID where the query was logged'
- name: jsonPayload.queryTime
type: number
description: 'The statement execution time in seconds'
- name: jsonPayload.lockTime
type: number
description: 'The time to acquire locks in seconds'
- name: jsonPayload.rowsSent
type: number
description: 'The number of rows sent to the client'
- name: jsonPayload.rowsExamined
type: number
description: 'The number of rows examined by the server layer'
- name: severity
type: string
description: ''
- name: jsonPayload.level
type: string
description: Log entry level
optional: true
configuration_options:
logs:
- type: mysql_error
fields:
- name: type
default: null
description: This value must be `mysql_error`.
- name: include_paths
default: '[/var/log/mysqld.log, /var/log/mysql/mysqld.log, /var/log/mysql/error.log]'
description: A list of filesystem paths to read by tailing each file. A wild card (`*`) can be used in the paths; for example, `/var/log/mysql/*.log`.
- name: exclude_paths
default: null
description: A list of filesystem path patterns to exclude from the set matched by `include_paths`.
- name: record_log_file_path
default: false
description: If set to `true`, then the path to the specific file from which the log record was obtained appears in the output log entry as the value of the `agent.googleapis.com/log_file_path` label. When using a wildcard, only the path of the file from which the record was obtained is recorded.
- name: wildcard_refresh_interval
default: 60s
description: The interval at which wildcard file paths in `include_paths` are refreshed. Given as a [time duration](https://pkg.go.dev/time#ParseDuration), for example `30s` or `2m`. This property might be useful under high logging throughputs where log files are rotated faster than the default interval.
- type: mysql_general
fields:
- name: type
default: null
description: This value must be `mysql_general`.
- name: include_paths
default: '[/var/lib/mysql/${HOSTNAME}.log]'
description: A list of filesystem paths to read by tailing each file. A wild card (`*`) can be used in the paths.
- name: exclude_paths
default: null
description: A list of filesystem path patterns to exclude from the set matched by `include_paths`.
- name: record_log_file_path
default: false
description: If set to `true`, then the path to the specific file from which the log record was obtained appears in the output log entry as the value of the `agent.googleapis.com/log_file_path` label. When using a wildcard, only the path of the file from which the record was obtained is recorded.
- name: wildcard_refresh_interval
default: 60s
description: The interval at which wildcard file paths in `include_paths` are refreshed. Given as a [time duration](https://pkg.go.dev/time#ParseDuration), for example `30s` or `2m`. This property might be useful under high logging throughputs where log files are rotated faster than the default interval.
- type: mysql_slow
fields:
- name: type
default: null
description: This value must be `mysql_slow`.
- name: include_paths
default: '[/var/lib/mysql/${HOSTNAME}-slow.log]'
description: A list of filesystem paths to read by tailing each file. A wild card (`*`) can be used in the paths.
- name: exclude_paths
default: null
description: A list of filesystem path patterns to exclude from the set matched by `include_paths`.
- name: record_log_file_path
default: false
description: If set to `true`, then the path to the specific file from which the log record was obtained appears in the output log entry as the value of the `agent.googleapis.com/log_file_path` label. When using a wildcard, only the path of the file from which the record was obtained is recorded.
- name: wildcard_refresh_interval
default: 60s
description: The interval at which wildcard file paths in `include_paths` are refreshed. Given as a [time duration](https://pkg.go.dev/time#ParseDuration), for example `30s` or `2m`. This property might be useful under high logging throughputs where log files are rotated faster than the default interval.
metrics:
- type: mysql
fields:
- name: type
default: null
description: This value must be `mysql`.
- name: endpoint
default: /var/run/mysqld/mysqld.sock
description: The `hostname:port` or Unix socket path starting with `/` used to connect to the MySQL server.
- name: username
default: root
description: The username used to connect to the server.
- name: password
default: null
description: The password used to connect to the server.
- name: collection_interval
default: 60s
description: A [time duration](https://pkg.go.dev/time#ParseDuration) value, such as `30s` or `5m`.