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 event log] add event log for alert execution and alerts scheduling actions #55636

Closed
pmuellr opened this issue Jan 22, 2020 · 4 comments · Fixed by #61706
Closed

[alerting event log] add event log for alert execution and alerts scheduling actions #55636

pmuellr opened this issue Jan 22, 2020 · 4 comments · Fixed by #61706
Assignees
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@pmuellr
Copy link
Member

pmuellr commented Jan 22, 2020

As the next parts of alerting to instrument with event log entries, it seems like alerting activities will be the most interesting thing to do. At a minimum this would be to add an event log entry when an alert executor indicates that actions should be run via scheduleActions(). We probably also want one when the alert execution function is run.

@pmuellr pmuellr added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jan 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@peterschretlen
Copy link
Contributor

To support the alert details view, and doing things like annotating charts with alert occurrences, we might also want to log

  • when a new alert instance is created
  • when an alert instance clears

Or status changes in between ( related to #51099 )

@mikecote
Copy link
Contributor

There's also some questions about if we should be tracking execution failures:

  • alert execution
  • alert action execution

@pmuellr
Copy link
Member Author

pmuellr commented Mar 27, 2020

There's also some questions about if we should be tracking execution failures:

  • alert execution
  • alert action execution

For alert execution, it appears we don't catch errors, which we'll need to start doing to generate event log entries with the error. Code here:

const updatedAlertTypeState = await this.alertType.executor({
alertId,
services: {
...services,
alertInstanceFactory: createAlertInstanceFactory(alertInstances),
},
params,
state: alertTypeState,
startedAt: this.taskInstance.startedAt!,
previousStartedAt: previousStartedAt ? new Date(previousStartedAt) : null,
spaceId,
namespace,
name,
tags,
createdBy,
updatedBy,
});

For alert action execution, the alert code just queues up the actions with task manager, so the only "error" would be in queuing up the work, I think.

There's a missing link, for action execution itself, in that it doesn't have an alert id - that would be nice, and we may need it - but we will be generating an event that includes both the alert and action id when the action is queued to be run. We could figure out how to pass a "producer" or such to action execution to track things like action ids.

pmuellr added a commit to pmuellr/kibana that referenced this issue Apr 2, 2020
resolves elastic#55636

Writes eventLog events for alert executions, and the actions executed from
that alert execution.
pmuellr added a commit that referenced this issue Apr 6, 2020
…ns (#61706)

resolves #55636

Writes eventLog events for alert executions, and the actions executed from
that alert execution.
pmuellr added a commit to pmuellr/kibana that referenced this issue Apr 6, 2020
…ns (elastic#61706)

resolves elastic#55636

Writes eventLog events for alert executions, and the actions executed from
that alert execution.
pmuellr added a commit that referenced this issue Apr 6, 2020
…ns (#61706) (#62622)

resolves #55636

Writes eventLog events for alert executions, and the actions executed from
that alert execution.
@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants