Skip to content

Commit 1f24766

Browse files
authored
[FA] Set display_priority in mysql spec.yaml (DataDog#23272)
* Set display_priority in mysql spec.yaml based on field usage * Add changelog entry for mysql * Update display_priority in mysql spec.yaml (enforce host/port and username/password adjacency) * Update display_priority in mysql: host/port/username/password as one group * Reorder fields in mysql spec.yaml by display_priority * Regenerate conf.yaml.example for mysql * Update display_priority in mysql spec.yaml based on field usage * Sync conf.yaml.example with spec.yaml
1 parent e37c229 commit 1f24766

3 files changed

Lines changed: 156 additions & 118 deletions

File tree

mysql/assets/configuration/spec.yaml

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ files:
66
- template: init_config
77
options:
88
- name: propagate_agent_tags
9+
display_priority: 0
910
description: |
1011
Set to `true` to propagate the tags from `datadog.yaml` to the check.
1112
When set to `true`, the tags from `datadog.yaml` are added to the check's tags for all instances.
@@ -24,6 +25,7 @@ files:
2425
- template: instances
2526
options:
2627
- name: host
28+
display_priority: 7
2729
description: |
2830
MySQL host to connect to.
2931
NOTE: Even if the host is "localhost", the agent connects to MySQL using TCP/IP, unless you also
@@ -35,7 +37,19 @@ files:
3537
example: localhost
3638
display_default: null
3739

40+
- name: port
41+
display_priority: 6
42+
description: |
43+
Port to use when connecting to MySQL.
44+
fleet_configurable: true
45+
enabled: true
46+
formats: ["port"]
47+
value:
48+
type: number
49+
example: 3306
50+
3851
- name: username
52+
display_priority: 5
3953
description: |
4054
Username used to connect to MySQL.
4155
fleet_configurable: true
@@ -46,6 +60,7 @@ files:
4660
display_default: null
4761

4862
- name: password
63+
display_priority: 4
4964
description: |
5065
Password associated to the MySQL user.
5166
fleet_configurable: true
@@ -54,17 +69,18 @@ files:
5469
value:
5570
type: string
5671

57-
- name: port
58-
description: |
59-
Port to use when connecting to MySQL.
72+
- name: dbm
73+
display_priority: 2
6074
fleet_configurable: true
61-
enabled: true
62-
formats: ["port"]
75+
description: |
76+
Set to `true` to enable Database Monitoring.
77+
enabled: false
6378
value:
64-
type: number
65-
example: 3306
66-
79+
type: boolean
80+
example: false
81+
display_default: false
6782
- name: propagate_agent_tags
83+
display_priority: 0
6884
description: |
6985
Set to `true` to propagate the tags from `datadog.yaml` to the check.
7086
When set to `true`, the tags from `datadog.yaml` are added to the check's tags for all instances.
@@ -73,20 +89,23 @@ files:
7389
type: boolean
7490

7591
- name: reported_hostname
92+
display_priority: 0
7693
description: |
7794
Set the reported hostname for this instance. This value overrides the hostname detected by the Agent
7895
and can be useful to set a custom hostname when connecting to a remote database through a proxy.
7996
fleet_configurable: true
8097
value:
8198
type: string
8299
- name: exclude_hostname
100+
display_priority: 0
83101
description: |
84102
Omit the hostname from tags and events. This is useful when the database host is not monitored by an agent.
85103
value:
86104
type: boolean
87105
example: false
88106
default: false
89107
- name: database_identifier
108+
display_priority: 0
90109
description: |
91110
Controls how the database is identified. Each unique value of this identifier will appear in DBM as a separate
92111
billable instance.
@@ -111,6 +130,7 @@ files:
111130
- mysql_sock: The socket path of the instance.
112131
In addition, you can use any key from the `tags` section of the configuration.
113132
- name: sock
133+
display_priority: 0
114134
description: |
115135
Path to a Unix Domain Socket to use when connecting to MySQL (instead of a TCP socket).
116136
If you specify a socket you don't need to specify a host.
@@ -119,13 +139,15 @@ files:
119139
type: string
120140
require_trusted_provider: true
121141
- name: charset
142+
display_priority: 0
122143
description: Charset you want to use.
123144
fleet_configurable: true
124145
value:
125146
type: string
126147
example: utf8
127148
display_default: null
128149
- name: defaults_file
150+
display_priority: 0
129151
description: |
130152
Path to an alternative configuration mechanism file.
131153
If providing this then there is no need to specify host, port, user, pass or socket.
@@ -134,6 +156,7 @@ files:
134156
require_trusted_provider: true
135157

136158
- name: connect_timeout
159+
display_priority: 0
137160
description: |
138161
Maximum number of seconds to wait before timing out when connecting to MySQL.
139162
The default connection timeout is 10 seconds.
@@ -143,6 +166,7 @@ files:
143166
example: 10
144167

145168
- name: read_timeout
169+
display_priority: 0
146170
description: |
147171
The timeout for reading from the connection in seconds.
148172
By default, no read timeout is set.
@@ -153,6 +177,7 @@ files:
153177
display_default: null
154178

155179
- name: ssl
180+
display_priority: 0
156181
description: |
157182
Use this section to configure a TLS connection between the Agent and MySQL.
158183
@@ -181,19 +206,8 @@ files:
181206
cert: <CERT_FILE_PATH>
182207
ca: <CA_PATH_FILE>
183208
check_hostname: true
184-
- template: instances/db
185-
overrides:
186-
custom_queries.value.example:
187-
- query: "SELECT foo, COUNT(*) FROM table.events GROUP BY foo"
188-
columns:
189-
- name: foo
190-
type: tag
191-
- name: event.total
192-
type: gauge
193-
tags:
194-
- test:mysql
195-
metric_prefix: mysql
196209
- name: additional_status
210+
display_priority: 0
197211
description: |
198212
Set this parameter to collect additional MySQL status variables as metrics
199213
from "SHOW GLOBAL STATUS"
@@ -215,6 +229,7 @@ files:
215229
type: rate
216230

217231
- name: additional_variable
232+
display_priority: 0
218233
description: |
219234
Set this parameter to collect additional MySQL variables as metrics
220235
from "SHOW GLOBAL VARIABLES"
@@ -235,6 +250,7 @@ files:
235250
type: gauge
236251

237252
- name: max_custom_queries
253+
display_priority: 0
238254
description: |
239255
Set the maximum number of custom queries to execute with this integration.
240256
@@ -244,6 +260,7 @@ files:
244260
example: 20
245261

246262
- name: queries
263+
display_priority: 0
247264
description: |
248265
Define custom queries to collect custom metrics from your MySQL database.
249266
@@ -264,6 +281,7 @@ files:
264281
field: <FIELD_NAME>
265282

266283
- name: options
284+
display_priority: 0
267285
description: |
268286
Enable options to collect extra metrics from your MySQL integration.
269287
@@ -399,16 +417,8 @@ files:
399417
type: boolean
400418
example: false
401419

402-
- name: dbm
403-
fleet_configurable: true
404-
description: |
405-
Set to `true` to enable Database Monitoring.
406-
enabled: false
407-
value:
408-
type: boolean
409-
example: false
410-
display_default: false
411420
- name: collect_settings
421+
display_priority: 0
412422
description: Configure collection of performance_schema.global_variables.
413423
options:
414424
- name: enabled
@@ -425,6 +435,7 @@ files:
425435
type: number
426436
example: 600
427437
- name: collect_schemas
438+
display_priority: 0
428439
description: |
429440
Configure collection of schemas (databases).
430441
Only tables and schemas for which the user has been granted SELECT privileges are collected.
@@ -449,6 +460,7 @@ files:
449460
type: number
450461
example: 60
451462
- name: schemas_collection
463+
display_priority: 0
452464
deprecation:
453465
Agent version: 7.69.0
454466
Migration: Use `collect_schemas` instead.
@@ -477,6 +489,7 @@ files:
477489
type: number
478490
example: 60
479491
- name: query_metrics
492+
display_priority: 0
480493
description: Configure collection of query metrics
481494
fleet_configurable: true
482495
options:
@@ -518,6 +531,7 @@ files:
518531
display_default: true
519532

520533
- name: query_samples
534+
display_priority: 0
521535
description: Configure collection of query samples
522536
fleet_configurable: true
523537
options:
@@ -627,6 +641,7 @@ files:
627641
type: integer
628642
example: 300
629643
- name: query_activity
644+
display_priority: 0
630645
description: Configure collection of active sessions monitoring
631646
options:
632647
- name: enabled
@@ -650,6 +665,7 @@ files:
650665
example: false
651666
display_default: false
652667
- name: index_metrics
668+
display_priority: 0
653669
description: |
654670
Configure collection of index metrics.
655671
Metrics provided by the options:
@@ -682,6 +698,7 @@ files:
682698
type: integer
683699
example: 1000
684700
- name: aws
701+
display_priority: 0
685702
description: |
686703
This block defines the configuration for AWS RDS and Aurora instances.
687704
@@ -736,6 +753,7 @@ files:
736753
type: string
737754
example: arn:aws:iam::123456789012:role/MyRole
738755
- name: gcp
756+
display_priority: 0
739757
description: |
740758
This block defines the configuration for Google Cloud SQL instances.
741759
@@ -765,6 +783,7 @@ files:
765783
example: foo-database
766784

767785
- name: azure
786+
display_priority: 0
768787
description: |
769788
This block defines the configuration for Azure Database for MySQL.
770789
@@ -798,6 +817,7 @@ files:
798817
example: mysql-database.database.windows.net
799818

800819
- name: obfuscator_options
820+
display_priority: 0
801821
description: |
802822
Configure how the SQL obfuscator behaves.
803823
Note: This option only applies when `dbm` is enabled.
@@ -903,6 +923,7 @@ files:
903923
example: false
904924
display_default: false
905925
- name: log_unobfuscated_queries
926+
display_priority: 0
906927
hidden: true
907928
description: |
908929
Set to `true` to enable logging of original unobfuscated SQL queries when obfuscation errors occur.
@@ -913,6 +934,7 @@ files:
913934
example: false
914935
display_default: false
915936
- name: log_unobfuscated_plans
937+
display_priority: 0
916938
hidden: true
917939
description: |
918940
Set to `true` to enable logging of original unobfuscated SQL plans when obfuscation errors occur.
@@ -923,6 +945,7 @@ files:
923945
example: false
924946
display_default: false
925947
- name: database_instance_collection_interval
948+
display_priority: 0
926949
hidden: true
927950
description: |
928951
Set the database instance collection interval (in seconds). The database instance collection sends
@@ -932,6 +955,19 @@ files:
932955
type: number
933956
example: 1800
934957
display_default: false
958+
- template: instances/db
959+
overrides:
960+
custom_queries.value.example:
961+
- query: "SELECT foo, COUNT(*) FROM table.events GROUP BY foo"
962+
columns:
963+
- name: foo
964+
type: tag
965+
- name: event.total
966+
type: gauge
967+
tags:
968+
- test:mysql
969+
metric_prefix: mysql
970+
custom_queries.display_priority: 1
935971
- template: instances/default
936972
overrides:
937973
disable_generic_tags.hidden: false
@@ -940,6 +976,7 @@ files:
940976
Replaces generic tag such as `server` with `mysql_server` to avoid getting it mixed with
941977
other integrations tags.
942978
979+
tags.display_priority: 3
943980
- template: logs
944981
example:
945982
- type: file

mysql/changelog.d/23272.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Re-order configuration fields based on real-world usage data.

0 commit comments

Comments
 (0)