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

Alerting task cancellation hooks #111639

Closed
wants to merge 6 commits into from

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Sep 8, 2021

Summary

  • Adds event log entry when task manager cancels alerting task
{
  "@timestamp" : "2021-09-09T13:38:02.287Z",
  "event" : {
    "provider" : "alerting",
    "action" : "cancelled",
    "kind" : "alert",
    "category" : [
      "AlertingExample"
    ]
  },
  "message" : "rule execution cancelled by task manager: \"69e65fb0-1164-11ec-b104-8d6e0d8799f7\"",
  "kibana" : {
    "saved_objects" : [
      {
        "rel" : "primary",
        "type" : "alert",
        "id" : "69e65fb0-1164-11ec-b104-8d6e0d8799f7",
        "type_id" : "example.always-firing"
      }
    ],
    "server_uuid" : "5b2de169-2785-441b-ae8c-186a1936b17d",
    "version" : "8.0.0"
  },
  "rule" : {
    "id" : "69e65fb0-1164-11ec-b104-8d6e0d8799f7",
    "license" : "basic",
    "category" : "example.always-firing",
    "ruleset" : "AlertingExample"
  },
  "ecs" : {
    "version" : "1.8.0"
  }
}
  • Aborts any in progress query when task manager cancels a task. This will cause the rule execution to error and log [error][alerting][plugins] Executing Alert default:.es-query:cbe82b90-117c-11ec-89fc-392cf9341229 has resulted in Error: Request aborted
  • Passes an executionIsCancelled function into the rule executor that rules can use to periodically check whether they should continue executing.
  • Checks whether execution is cancelled before scheduling actions. If execution is cancelled, logs a message and doesn't schedule any actions.

@kibanamachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants