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

Support for output_metric_tags in check module #364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
30 changes: 29 additions & 1 deletion plugins/modules/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,17 @@
- opentsdb_line
output_metric_handlers:
description:
- List of handlers which receive check results. I'm not sure why this exists.
- List of handlers which receive check results.
type: list
elements: str
output_metric_tags:
description:
- Custom tags to enrich metric points produced by check output metric
extraction.
- See check metrics example below for more information on exact mapping
structure.
type: list
elements: dict
round_robin:
description:
- An array of environment variables to use with command execution.
Expand Down Expand Up @@ -220,6 +228,21 @@
- failing-hook
- always-run-this-hook

- name: Check that collects metrics
sensu.sensu_go.check:
name: check
command: check-cpu.sh -w 75 -c 90
subscriptions:
- checks
interval: 30
output_metric_format: nagios_perfdata
output_metric_handlers:
- influxdb
output_metric_tags:
- name: sensu_check_name
value: check
publish: yes

- name: Remove check
sensu.sensu_go.check:
name: my-check
Expand Down Expand Up @@ -323,6 +346,7 @@ def build_api_payload(params):
'low_flap_threshold',
'output_metric_format',
'output_metric_handlers',
'output_metric_tags',
'proxy_entity_name',
'publish',
'round_robin',
Expand Down Expand Up @@ -423,6 +447,10 @@ def main():
output_metric_handlers=dict(
type='list', elements='str',
),
output_metric_tags=dict(
type='list', elements='dict',
#type='dict',
),
round_robin=dict(
type='bool'
)
Expand Down