Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config spec #7531

Merged
merged 5 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions tcp_check/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: TCP
files:
- name: tcp_check.yaml
options:
- template: init_config
options:
- template: init_config/default
- template: instances
options:
- name: name
description: Name to assign to your TCP check instance.
required: true
value:
type: string
default: null
example: <TCP_CHECK_INSTANCE_NAME>
- name: host
description: Host to connect to.
required: true
value:
type: string
default: null
example: <TCP_HOST_TO_CONNECT_TO>
- name: port
description: Port of the host to connect to.
required: true
value:
type: integer
- name: timeout
description: Timeout of the TCP query in second.
value:
type: integer
example: 10
- name: collect_response_time
description: |
The `collect_response_time` parameter instructs the check to create a
metric 'network.tcp.response_time', tagged with the host name,
reporting the response time in seconds.
value:
type: boolean
example: false
- template: instances/default
39 changes: 35 additions & 4 deletions tcp_check/datadog_checks/tcp_check/data/conf.yaml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
## All options defined here are available to all instances.
#
init_config:

## @param service - string - optional
## Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration.
##
## Additionally, this sets the default `service` for every log source.
#
# service: <SERVICE>

## Every instance is scheduled independent of the others.
#
instances:

## @param name - string - required
Expand All @@ -15,7 +26,7 @@ instances:
## @param port - integer - required
## Port of the host to connect to.
#
port: <HOST_PORT>
port: <PORT>

## @param timeout - integer - optional - default: 10
## Timeout of the TCP query in second.
Expand All @@ -29,11 +40,31 @@ instances:
#
# collect_response_time: false

## @param tags - list of key:value elements - optional
## List of tags to attach to every metric, event, and service check emitted by this Integration.
## @param tags - list of strings - optional
## A list of tags to attach to every metric and service check emitted by this instance.
##
## Learn more about tagging: https://docs.datadoghq.com/tagging/
## Learn more about tagging at https://docs.datadoghq.com/tagging
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>

## @param service - string - optional
## Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration.
##
## Overrides any `service` defined in the `init_config` section.
#
# service: <SERVICE>

## @param min_collection_interval - number - optional - default: 15
## This changes the collection interval of the check. For more information, see:
## https://docs.datadoghq.com/developers/write_agent_check/#collection-interval
#
# min_collection_interval: 15

## @param empty_default_hostname - boolean - optional - default: false
## This forces the check to send metrics with no hostname.
##
## This is useful for cluster-level checks.
#
# empty_default_hostname: false
3 changes: 3 additions & 0 deletions tcp_check/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"type": "check",
"integration_id": "system",
"assets": {
"configuration": {
"spec": "assets/configuration/spec.yaml"
},
"monitors": {},
"dashboards": {},
"service_checks": "assets/service_checks.json",
Expand Down
2 changes: 1 addition & 1 deletion tcp_check/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_dependencies():
return f.readlines()


CHECKS_BASE_REQ = 'datadog_checks_base>=4.2.0'
CHECKS_BASE_REQ = 'datadog-checks-base>=11.0.0'

setup(
name='datadog-tcp_check',
Expand Down