Skip to content

Commit

Permalink
Remove required when there are default values
Browse files Browse the repository at this point in the history
  • Loading branch information
hithwen committed Jun 4, 2021
1 parent c3099da commit 2b1ebc5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 0 additions & 2 deletions yarn/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ files:
The ResourceManager port can be found in the yarn-site.xml conf file under
the property yarn.resourcemanager.webapp.address
required: true
value:
example: http://localhost:8088
type: string
- name: cluster_name
description: A friendly name for the cluster.
required: true
value:
example: default_cluster
type: string
Expand Down
8 changes: 8 additions & 0 deletions yarn/datadog_checks/yarn/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def instance_aws_service(field, value):
return get_default_field_value(field, value)


def instance_cluster_name(field, value):
return 'default_cluster'


def instance_collect_app_metrics(field, value):
return True

Expand Down Expand Up @@ -136,6 +140,10 @@ def instance_read_timeout(field, value):
return get_default_field_value(field, value)


def instance_resourcemanager_uri(field, value):
return 'http://localhost:8088'


def instance_service(field, value):
return get_default_field_value(field, value)

Expand Down
4 changes: 2 additions & 2 deletions yarn/datadog_checks/yarn/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Config:
aws_host: Optional[str]
aws_region: Optional[str]
aws_service: Optional[str]
cluster_name: str
cluster_name: Optional[str]
collect_app_metrics: Optional[bool]
collect_node_metrics: Optional[bool]
connect_timeout: Optional[float]
Expand All @@ -64,7 +64,7 @@ class Config:
proxy: Optional[Proxy]
queue_blacklist: Optional[Sequence[str]]
read_timeout: Optional[float]
resourcemanager_uri: str
resourcemanager_uri: Optional[str]
service: Optional[str]
skip_proxy: Optional[bool]
split_yarn_application_tags: Optional[bool]
Expand Down
9 changes: 5 additions & 4 deletions yarn/datadog_checks/yarn/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ init_config:
#
instances:

## @param resourcemanager_uri - string - required
-
## @param resourcemanager_uri - string - optional - default: http://localhost:8088
## The YARN check retrieves metrics from YARNS's ResourceManager. This
## check must be run from the Master Node and the ResourceManager URI must
## be specified below. The ResourceManager URI is composed of the
Expand All @@ -56,12 +57,12 @@ instances:
## The ResourceManager port can be found in the yarn-site.xml conf file under
## the property yarn.resourcemanager.webapp.address
#
- resourcemanager_uri: http://localhost:8088
# resourcemanager_uri: http://localhost:8088

## @param cluster_name - string - required
## @param cluster_name - string - optional - default: default_cluster
## A friendly name for the cluster.
#
cluster_name: default_cluster
# cluster_name: default_cluster

## @param application_tags - mapping - optional
## Set up tags retrieved from the application data to be applied to the
Expand Down

0 comments on commit 2b1ebc5

Please sign in to comment.