Skip to content

Commit

Permalink
Rename config spec example consumer option default to `display_defa…
Browse files Browse the repository at this point in the history
…ult` (DataDog#8593)
  • Loading branch information
ofek authored Feb 11, 2021
1 parent 3a7d381 commit e6bce64
Show file tree
Hide file tree
Showing 35 changed files with 133 additions and 132 deletions.
4 changes: 2 additions & 2 deletions cilium/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ files:
value:
type: string
example: http://localhost:9090/metrics
default: None
display_default: None
- name: operator_endpoint
description: |
Provide instead of `agent_endpoint` to collect `cilium-operator` metrics.
Cilium operator metrics are exposed on port 6942.
value:
type: string
example: http://localhost:6942/metrics
default: None
display_default: None
- template: instances/openmetrics_legacy
overrides:
prometheus_url.hidden: true
Expand Down
2 changes: 1 addition & 1 deletion cisco_aci/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ files:
aws_service.hidden: true
- template: instances/default
overrides:
min_collection_interval.value.default: 15
min_collection_interval.value.display_default: 15
min_collection_interval.value.example: 180
2 changes: 1 addition & 1 deletion clickhouse/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ files:
description: The database to connect to.
value:
type: string
default: default
display_default: default
- name: connect_timeout
description: The timeout for connecting to the `server`.
value:
Expand Down
3 changes: 1 addition & 2 deletions cloud_foundry_api/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ files:
value:
type: integer
maximum: 5000
default: 100
display_default: 100
- template: instances/default
- template: instances/http
overrides:
Expand All @@ -65,4 +65,3 @@ files:
options:
- template: init_config/default
- template: init_config/http

8 changes: 4 additions & 4 deletions couch/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ files:
example:
- <DATABASE_1>
- <DATABASE_2>
default: all
display_default: all
- name: db_exclude
description: |
The `db_exclude` should contain the names of any databases meant to be excluded
Expand All @@ -43,7 +43,7 @@ files:
example:
- <DATABASE_1>
- <DATABASE_2>
default: None
display_default: None
- name: max_dbs_per_check
description: Number of databases to scan per check.
value:
Expand All @@ -54,13 +54,13 @@ files:
value:
type: string
example: <ERLANG_NAME>
default: None
display_default: None
- name: max_nodes_per_check
description: CouchDB 2.x only. How many nodes each check reports if no name is provided.
value:
type: integer
example: 10
default: 20
display_default: 20
- template: instances/default
- template: instances/http
overrides:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def write_option(option, writer, indent='', start_list=False):
example = value.get('example')
example_type = type(example)
if not required:
if 'default' in value:
default = value['default']
if 'display_default' in value:
default = value['display_default']
default_type = type(default)
if default is not None and str(default).lower() != 'none':
if default_type is str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
type: array
items:
type: object
default: null
display_default: null
example:
- query: <QUERY>
columns: <COLUMNS>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
value:
type: boolean
example: false
default: false
display_default: false
- name: service_check_prefix
description: |
Custom service check prefix. e.g. `my_prefix` to get a service check called `my_prefix.can_connect`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
value:
type: string
example: <PREFIX>_
default: null
display_default: null
- name: metrics # Only shown for the `openmetrics` provider integration
hidden: true
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
value:
type: string
example: <PREFIX>_
default: null
display_default: null
- name: health_service_check
description: |
Send a service check reporting about the health of the Prometheus endpoint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def test_option_string_type_not_default_example_default_value_none():
value:
type: string
example: something
default: None
display_default: None
"""
)

Expand Down Expand Up @@ -840,7 +840,7 @@ def test_option_string_type_not_default_example_default_value_null():
value:
type: string
example: something
default: null
display_default: null
"""
)

Expand Down Expand Up @@ -1294,7 +1294,7 @@ def test_option_default_example_override_null():
value:
type: string
example: something
default: null
display_default: null
"""
)

Expand Down Expand Up @@ -1325,7 +1325,7 @@ def test_option_default_example_override_string():
value:
type: string
example: something
default: bar
display_default: bar
"""
)

Expand Down Expand Up @@ -1356,7 +1356,7 @@ def test_option_default_example_override_non_string():
value:
type: string
example: something
default:
display_default:
foo: [bar, baz]
"""
)
Expand Down
4 changes: 2 additions & 2 deletions disk/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ files:
Works on Linux only.
value:
example: /run/blkid/blkid.tab
default: null
display_default: null
type: string
- name: device_tag_re
description: |
Expand All @@ -215,7 +215,7 @@ files:
description: Timeout of the disk query in seconds
value:
example: 5
default: 5
display_default: 5
type: integer
- name: create_mounts
description: |
Expand Down
4 changes: 3 additions & 1 deletion docs/developer/meta/config-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ It respects a few extra [option](#options)-level attributes:

- `example` - A complete example of an option in lieu of a strictly typed `value` attribute
- `enabled` - Whether or not to un-comment the option, overriding the behavior of `required`
- `display_priority` - This is an integer affecting the order in which options are displayed, with higher values indicating higher priority.
The default is `0`.

It also respects a few extra fields under the `value` attribute of each option:

- `default` - This is the default value that will be shown in the header of each option, useful if it differs from the `example`.
- `display_default` - This is the default value that will be shown in the header of each option, useful if it differs from the `example`.
You may set it to `null` explicitly to disable showing this part of the header.
- `compact_example` - Whether or not to display complex types like arrays in their most compact representation. It defaults to `false`.

Expand Down
2 changes: 1 addition & 1 deletion go_expvar/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ files:
description: Define your namespace that is prefixed to all metrics collected by this check.
value:
type: string
default: go_expvar
display_default: go_expvar
- name: metrics
description: |
These metrics are just here as examples.
Expand Down
12 changes: 6 additions & 6 deletions istio/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ files:
Collect mixer, galley, pilot, and citadel metrics available from the istiod deployment.
Only available for Istio >= v1.5.
value:
default: null
display_default: null
example: http://istiod.istio-system:15014/metrics
type: string
- name: istio_mesh_endpoint
Expand All @@ -25,7 +25,7 @@ files:
When collecting mesh metrics in Istio < v1.5, use
istio_mesh_endpoint: http://istio-telemetry.istio-system:42422/metrics
value:
default: null
display_default: null
example: http://istio-proxy.istio-system:15090/stats/prometheus
type: string
- name: mixer_endpoint
Expand All @@ -35,31 +35,31 @@ files:
If using Istio < v1.1, replace port 15014 with port 9093. See the changes here:
https://istio.io/about/notes/1.1/#configuration-management
value:
default: null
display_default: null
example: http://istio-telemetry.istio-system:15014/metrics
type: string
- name: pilot_endpoint
description: |
Define the pilot endpoint in order to collect all Prometheus metrics on the Pilot process.
Only available for Istio >= v1.1.
value:
default: null
display_default: null
example: http://istio-pilot.istio-system:15014/metrics
type: string
- name: galley_endpoint
description: |
Define the galley endpoint in order to collect all Prometheus metrics on the Galley process.
Only available for Istio >= v1.1.
value:
default: null
display_default: null
example: http://istio-galley.istio-system:15014/metrics
type: string
- name: citadel_endpoint
description: |
Define the citadel endpoint in order to collect all Prometheus metrics on the Citadel process.
Only available for Istio >= v1.1.
value:
default: null
display_default: null
example: http://istio-citadel.istio-system:15014/metrics
type: string
- template: instances/openmetrics_legacy
Expand Down
Loading

0 comments on commit e6bce64

Please sign in to comment.