this mutator is almost what we want (check.status
would be better), but I have some trouble, seems the mutator is configured correctly because I can see the handler is executed successfully in the sensu backend and I see a connection on graphite but I can find anything in grafana!
sensu backend log
sensu/sensu-backend-2[sensu-backend]: {"check_name":"keepalive","check_namespace":"LAB","component":"pipelined","entity_name":"fedora-dpg","entity_namespace":"LAB","event_id":"0bfd0688-1b8e-4c0f-83ad-12a60014d8ba","handler":"graphite-keepalive","level":"debug","msg":"allowing event","time":"2021-07-01T12:32:28+02:00"}
sensu/sensu-backend-2[sensu-backend]: {"check_name":"keepalive","check_namespace":"LAB","component":"pipelined","entity_name":"fedora-dpg","entity_namespace":"LAB","event_id":"0bfd0688-1b8e-4c0f-83ad-12a60014d8ba","handler":"graphite-keepalive","level":"info","msg":"sending event to handler","time":"2021-07-01T12:32:28+02:00"}
sensu/sensu-backend-2[sensu-backend]: {"check_name":"keepalive","check_namespace":"LAB","component":"pipelined","entity_name":"fedora-dpg","entity_namespace":"LAB","event_id":"0bfd0688-1b8e-4c0f-83ad-12a60014d8ba","handler_name":"graphite-keepalive","handler_namespace":"LAB","handler_protocol":"tcp","level":"debug","msg":"sending event to socket handler","time":"2021-07-01T12:32:28+02:00"}
sensu/sensu-backend-2[sensu-backend]: {"bytes":69,"check_name":"keepalive","check_namespace":"LAB","component":"pipelined","entity_name":"fedora-dpg","entity_namespace":"LAB","event_id":"0bfd0688-1b8e-4c0f-83ad-12a60014d8ba","handler_name":"graphite-keepalive","handler_namespace":"LAB","handler_protocol":"tcp","level":"info","msg":"event socket handler executed","time":"2021-07-01T12:32:28+02:00"}
graphite log:
graphite/graphite-0[graphite]: 01/07/2021 10:32:28 :: [listener] MetricLineReceiver connection with x.x.x.x:42424 established
graphite/graphite-0[graphite]: 01/07/2021 10:32:28 :: [listener] MetricLineReceiver connection with x.x.x.x:42424 closed cleanly
this is my handler definition:
---
type: Handler
api_version: core/v2
metadata:
name: keepalive
namespace: LAB
spec:
handlers:
- graphite-keepalive
type: set
---
type: Handler
api_version: core/v2
metadata:
name: graphite-keepalive
namespace: LAB
spec:
mutator: only_check_output
socket:
host: x.x.x.x
port: 2003
type: tcp