-
Notifications
You must be signed in to change notification settings - Fork 312
Description
dog
script's service_check
, monitor
options are not required, but are still sent (as null) when not provided. Assuming this is the behavior for all script commands.
Reproduce:
$ dog service_check check check_pg host0 0
ERROR: "message" parameter should be a string
The actual payload / body sent to server includes nulled options, when not specified.
{"status": 0, "tags": null, "timestamp": null, "host_name": "host0", "message": null, "check": "check_pg"}
Relates:
https://github.com/DataDog/datadogpy/blob/master/datadog/dogshell/service_check.py#L32
https://github.com/DataDog/datadogpy/blob/master/datadog/api/service_checks.py#L39
https://github.com/DataDog/datadogpy/blob/master/datadog/api/api_client.py#L112
https://github.com/DataDog/datadogpy/blob/master/datadog/api/api_client.py#L127
This could be fixed locally in datadog.dogshell.service_checkto not submit
Noneoptions; or this could be fixed in
datadog.api.service_checksor
datadog.api.api_client`.
The first would have the most localized effect / least possibility for wider side effects to other tests, but if there are no cases for submitting null values to the DataDog API, then I would definitely recommend mitigating this directly in datadog.api.api_client
.