sensu-go icon indicating copy to clipboard operation
sensu-go copied to clipboard

Feature Enhancement: include handler name in pipeline filter deny/accept messages

Open jspaleta opened this issue 3 years ago • 0 comments

When pipeline filter prevents a workflow from executing, the debug message doesn't include the handler name leading to head scratcher situations when trying to debug why a specific handler is/isn't firing.

Feature Suggestion

Add the name of the handler attached to the workflow into the filter mesage

Possible Implementation

Add workflow_handler attribute with workflow handler name value in the filter message

Context

When trying to debug why a handler wasn't sending data using the new pipeline resource, trying to grep the logs looking for any info about that particular handler was a no bueno experience. Turns out after careful review that a filter was active that should not have been. And going back into the logs again we found the log message referencing the pipeline workflow name not the handler name. But instinctively the first several log searchers were for the handler name.

Here's example json output of the debug log from a deny pipeline filter

{
  "check_name": "system-check",
  "check_namespace": "default",
  "component": "pipeline/filter",
  "entity_name": "i-0806e2614df3fece2",
  "entity_namespace": "default",
  "event_id": "2906e7c7-f5c2-4e3b-8de7-8805cd6d94d9",
  "first_metric_name": "system_cpu_cores",
  "first_metric_value": 4,
  "level": "debug",
  "metric_count": 70,
  "msg": "denying event that is not an incident/resolution",
  "pipeline": "sumologic",
  "pipeline_workflow": "sumologic-logs",
  "time": "2021-11-17T01:16:36Z"
}

It would be real nice to add "workflow_handler": "blahblahblah" into the json attribute list as each workflow is connected to exactly one handler, making it more likely to hit that particular log on a log search for that handler.

jspaleta avatar Nov 17 '21 01:11 jspaleta