Skip to content

Commit e2e1fb5

Browse files
authored
[FA] Set display_priority in elastic spec.yaml (DataDog#23278)
* Set display_priority in elastic spec.yaml based on field usage * Add changelog entry for elastic * Reorder fields in elastic spec.yaml by display_priority
1 parent cbc4279 commit e2e1fb5

3 files changed

Lines changed: 95 additions & 77 deletions

File tree

elastic/assets/configuration/spec.yaml

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ files:
1010
- template: instances
1111
options:
1212
- name: url
13+
display_priority: 7
1314
fleet_configurable: true
1415
required: true
1516
description: |
@@ -19,88 +20,98 @@ files:
1920
value:
2021
example: http://localhost:9200
2122
type: string
22-
- name: node_name_as_host
23+
- name: pshard_stats
24+
display_priority: 6
2325
description: |
24-
If each machine only runs a single Elasticsearch node per cluster, you
25-
want to set each Elasticsearch `node.name` to the machine hostname. You may
26-
then set `node_name_as_host` to `true` to avoid duplicate hostnames.
27-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html
26+
If you enable the `pshard_stats` flag, statistics over primary shards
27+
are collected by the check and sent to the backend with the
28+
`elasticsearch.primary` prefix. It is particularly useful if you want to
29+
get certain metrics without taking replicas into account. For instance,
30+
`elasticsearch.primaries.docs.count` gives you the total number of
31+
documents in your indexes WITHOUT counting duplicates due to the existence
32+
of replica shards in your ES cluster.
2833
fleet_configurable: true
2934
value:
3035
type: boolean
3136
example: false
32-
- name: cluster_stats
33-
description: |
34-
If your cluster is hosted externally (i.e., you're not pointing to localhost),
35-
you must set `cluster_stats` to true, otherwise the check only
36-
submits metrics of the local node.
37-
This parameter was also called `is_external` and you can still use it but it
38-
is removed in Agent version 6+.
37+
- name: index_stats
38+
display_priority: 5
39+
description: Set `index_stats` to true to collect metrics for individual indices.
3940
fleet_configurable: true
4041
value:
4142
type: boolean
4243
example: false
43-
- name: detailed_index_stats
44+
- name: pending_task_stats
45+
display_priority: 4
4446
description: |
45-
If you want to obtain index-specific stats, use this flag with `cluster_stats` and `pshard_stats` set to true.
46-
Without this flag you only get stats from `_all`.
47-
Do not use it if you are pointing to localhost.
47+
Specifies whether to collect data exposed by the `pending_tasks` cluster endpoint.
48+
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html
49+
Some managed Elasticsearch services (e.g., AWS Elasticsearch) do not expose this endpoint.
50+
Set `pending_task_stats` to false if you use such a service.
4851
fleet_configurable: true
4952
value:
5053
type: boolean
51-
example: false
52-
- name: index_stats
53-
description: Set `index_stats` to true to collect metrics for individual indices.
54+
example: true
55+
- name: cluster_stats
56+
display_priority: 3
57+
description: |
58+
If your cluster is hosted externally (i.e., you're not pointing to localhost),
59+
you must set `cluster_stats` to true, otherwise the check only
60+
submits metrics of the local node.
61+
This parameter was also called `is_external` and you can still use it but it
62+
is removed in Agent version 6+.
5463
fleet_configurable: true
5564
value:
5665
type: boolean
5766
example: false
58-
- name: pshard_stats
67+
- name: cat_allocation_stats
68+
display_priority: 2
5969
description: |
60-
If you enable the `pshard_stats` flag, statistics over primary shards
61-
are collected by the check and sent to the backend with the
62-
`elasticsearch.primary` prefix. It is particularly useful if you want to
63-
get certain metrics without taking replicas into account. For instance,
64-
`elasticsearch.primaries.docs.count` gives you the total number of
65-
documents in your indexes WITHOUT counting duplicates due to the existence
66-
of replica shards in your ES cluster.
70+
Enable to collect Elastic Cat Allocation metrics. Available only for Elasticsearch 5.0 or higher.
71+
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html.
6772
fleet_configurable: true
6873
value:
6974
type: boolean
7075
example: false
7176
- name: slm_stats
77+
display_priority: 1
7278
description: |
7379
Set `slm_stats` to true to collect statistics about Snapshot Lifecycle Management.
7480
The user must have the `read_slm` cluster privilege to get these metrics.
7581
fleet_configurable: true
7682
value:
7783
type: boolean
7884
example: false
79-
- name: pshard_graceful_timeout
80-
description: Continue gracefully if pshard stats timeout.
85+
- name: node_name_as_host
86+
display_priority: 0
87+
description: |
88+
If each machine only runs a single Elasticsearch node per cluster, you
89+
want to set each Elasticsearch `node.name` to the machine hostname. You may
90+
then set `node_name_as_host` to `true` to avoid duplicate hostnames.
91+
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html
8192
fleet_configurable: true
8293
value:
8394
type: boolean
8495
example: false
85-
- name: pending_task_stats
96+
- name: detailed_index_stats
97+
display_priority: 0
8698
description: |
87-
Specifies whether to collect data exposed by the `pending_tasks` cluster endpoint.
88-
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html
89-
Some managed Elasticsearch services (e.g., AWS Elasticsearch) do not expose this endpoint.
90-
Set `pending_task_stats` to false if you use such a service.
99+
If you want to obtain index-specific stats, use this flag with `cluster_stats` and `pshard_stats` set to true.
100+
Without this flag you only get stats from `_all`.
101+
Do not use it if you are pointing to localhost.
91102
fleet_configurable: true
92103
value:
93104
type: boolean
94-
example: true
95-
- name: cat_allocation_stats
96-
description: |
97-
Enable to collect Elastic Cat Allocation metrics. Available only for Elasticsearch 5.0 or higher.
98-
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html.
105+
example: false
106+
- name: pshard_graceful_timeout
107+
display_priority: 0
108+
description: Continue gracefully if pshard stats timeout.
99109
fleet_configurable: true
100110
value:
101111
type: boolean
102112
example: false
103113
- name: detailed_shard_metrics
114+
display_priority: 0
104115
description: |
105116
Enable to collect detailed shard placement metrics with `index_name` and `prirep` (primary/replica) tags.
106117
Requires `cat_allocation_stats` to be enabled.
@@ -112,6 +123,7 @@ files:
112123
type: boolean
113124
example: false
114125
- name: admin_forwarder
126+
display_priority: 0
115127
description: |
116128
Specifies a URL that includes a context root
117129
needed for a forwarder application to access Elasticsearch REST services, for example:
@@ -121,6 +133,7 @@ files:
121133
type: boolean
122134
example: false
123135
- name: gc_collectors_as_rate
136+
display_priority: 0
124137
description: |
125138
Submit `jvm.gc.collectors` metrics as rate.
126139
Note: Only for ES versions 0.9.10 or higher.
@@ -129,6 +142,7 @@ files:
129142
type: boolean
130143
example: false
131144
- name: disable_legacy_cluster_tag
145+
display_priority: 0
132146
description: Enable to stop submitting the tag `cluster_name`, which has been renamed to `elastic_cluster`.
133147
fleet_configurable: true
134148
value:
@@ -137,6 +151,7 @@ files:
137151
example: true
138152
enabled: false
139153
- name: disable_legacy_service_check_tags
154+
display_priority: 0
140155
description: |
141156
Disable the submission of the Elasticsearch `host` and `port` as tags in service checks.
142157
Submit them as `url` instead.
@@ -147,6 +162,7 @@ files:
147162
example: true
148163
enabled: true
149164
- name: custom_queries
165+
display_priority: 0
150166
description: |
151167
Run custom queries for Elasticsearch. Each custom query endpoint can collect multiple metrics and tags.
152168
Note: Each custom query requires an `endpoint`, `data_path`, and `columns` parameter. Each `columns` parameter
@@ -220,6 +236,7 @@ files:
220236
items:
221237
type: string
222238
- name: submit_events
239+
display_priority: 0
223240
description: |
224241
By default we submit events to Datadog if the cluster starts unhealthy or anytime its health changes.
225242
You can set this option to `false` to disable submitting the events in case you already implemented

elastic/changelog.d/23278.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.

elastic/datadog_checks/elastic/data/conf.yaml.example

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -51,35 +51,6 @@ instances:
5151
#
5252
- url: http://localhost:9200
5353

54-
## @param node_name_as_host - boolean - optional - default: false
55-
## If each machine only runs a single Elasticsearch node per cluster, you
56-
## want to set each Elasticsearch `node.name` to the machine hostname. You may
57-
## then set `node_name_as_host` to `true` to avoid duplicate hostnames.
58-
## See: https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html
59-
#
60-
# node_name_as_host: false
61-
62-
## @param cluster_stats - boolean - optional - default: false
63-
## If your cluster is hosted externally (i.e., you're not pointing to localhost),
64-
## you must set `cluster_stats` to true, otherwise the check only
65-
## submits metrics of the local node.
66-
## This parameter was also called `is_external` and you can still use it but it
67-
## is removed in Agent version 6+.
68-
#
69-
# cluster_stats: false
70-
71-
## @param detailed_index_stats - boolean - optional - default: false
72-
## If you want to obtain index-specific stats, use this flag with `cluster_stats` and `pshard_stats` set to true.
73-
## Without this flag you only get stats from `_all`.
74-
## Do not use it if you are pointing to localhost.
75-
#
76-
# detailed_index_stats: false
77-
78-
## @param index_stats - boolean - optional - default: false
79-
## Set `index_stats` to true to collect metrics for individual indices.
80-
#
81-
# index_stats: false
82-
8354
## @param pshard_stats - boolean - optional - default: false
8455
## If you enable the `pshard_stats` flag, statistics over primary shards
8556
## are collected by the check and sent to the backend with the
@@ -91,16 +62,10 @@ instances:
9162
#
9263
# pshard_stats: false
9364

94-
## @param slm_stats - boolean - optional - default: false
95-
## Set `slm_stats` to true to collect statistics about Snapshot Lifecycle Management.
96-
## The user must have the `read_slm` cluster privilege to get these metrics.
97-
#
98-
# slm_stats: false
99-
100-
## @param pshard_graceful_timeout - boolean - optional - default: false
101-
## Continue gracefully if pshard stats timeout.
65+
## @param index_stats - boolean - optional - default: false
66+
## Set `index_stats` to true to collect metrics for individual indices.
10267
#
103-
# pshard_graceful_timeout: false
68+
# index_stats: false
10469

10570
## @param pending_task_stats - boolean - optional - default: true
10671
## Specifies whether to collect data exposed by the `pending_tasks` cluster endpoint.
@@ -110,12 +75,47 @@ instances:
11075
#
11176
# pending_task_stats: true
11277

78+
## @param cluster_stats - boolean - optional - default: false
79+
## If your cluster is hosted externally (i.e., you're not pointing to localhost),
80+
## you must set `cluster_stats` to true, otherwise the check only
81+
## submits metrics of the local node.
82+
## This parameter was also called `is_external` and you can still use it but it
83+
## is removed in Agent version 6+.
84+
#
85+
# cluster_stats: false
86+
11387
## @param cat_allocation_stats - boolean - optional - default: false
11488
## Enable to collect Elastic Cat Allocation metrics. Available only for Elasticsearch 5.0 or higher.
11589
## Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html.
11690
#
11791
# cat_allocation_stats: false
11892

93+
## @param slm_stats - boolean - optional - default: false
94+
## Set `slm_stats` to true to collect statistics about Snapshot Lifecycle Management.
95+
## The user must have the `read_slm` cluster privilege to get these metrics.
96+
#
97+
# slm_stats: false
98+
99+
## @param node_name_as_host - boolean - optional - default: false
100+
## If each machine only runs a single Elasticsearch node per cluster, you
101+
## want to set each Elasticsearch `node.name` to the machine hostname. You may
102+
## then set `node_name_as_host` to `true` to avoid duplicate hostnames.
103+
## See: https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html
104+
#
105+
# node_name_as_host: false
106+
107+
## @param detailed_index_stats - boolean - optional - default: false
108+
## If you want to obtain index-specific stats, use this flag with `cluster_stats` and `pshard_stats` set to true.
109+
## Without this flag you only get stats from `_all`.
110+
## Do not use it if you are pointing to localhost.
111+
#
112+
# detailed_index_stats: false
113+
114+
## @param pshard_graceful_timeout - boolean - optional - default: false
115+
## Continue gracefully if pshard stats timeout.
116+
#
117+
# pshard_graceful_timeout: false
118+
119119
## @param detailed_shard_metrics - boolean - optional - default: false
120120
## Enable to collect detailed shard placement metrics with `index_name` and `prirep` (primary/replica) tags.
121121
## Requires `cat_allocation_stats` to be enabled.

0 commit comments

Comments
 (0)