Skip to content

[Alerting] Add event log entry when a rule starts executing#102001

Merged
chrisronline merged 11 commits intoelastic:masterfrom
chrisronline:alerting/rule_execution_starts
Jun 17, 2021
Merged

[Alerting] Add event log entry when a rule starts executing#102001
chrisronline merged 11 commits intoelastic:masterfrom
chrisronline:alerting/rule_execution_starts

Conversation

@chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Jun 11, 2021

Resolves #101507

This PR adds an additional event to the event log that indicates when an alert starts executing. Currently, we only log to the event log when the alert finishes execution which helps us understand what rules finished execution and when, but it does not tell us which rules started executing but never finished. This PR aims to address this which will help diagnose issues with rules not executing as expected.

@chrisronline chrisronline marked this pull request as ready for review June 15, 2021 15:36
@chrisronline chrisronline requested a review from a team as a code owner June 15, 2021 15:36
@chrisronline chrisronline added Feature:Alerting Feature:EventLog Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// labels Jun 15, 2021
@elasticmachine
Copy link
Contributor

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

@ymao1
Copy link
Contributor

ymao1 commented Jun 15, 2021

There are some functional tests for event log in x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts that would be good to update.

@chrisronline
Copy link
Contributor Author

Great tip @ymao1! I've updated those tests to account for this new event log entry!

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested out some rules locally and saw the execute-start event log entry for event.provider: alerting.

Do you think we should add the same thing for actions? There is an execute document for actions that gets written at the end of action execution. Is there value in adding an execute-start document as well?

@chrisronline
Copy link
Contributor Author

@ymao1 I agree! I think we can handle it separately, so I opened #102358

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@mikecote mikecote self-requested a review June 17, 2021 17:51
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM! Tested locally and saw the start events logged.

@chrisronline chrisronline merged commit 9bbb9e4 into elastic:master Jun 17, 2021
chrisronline added a commit to chrisronline/kibana that referenced this pull request Jun 17, 2021
…102001)

* Add event log entry when a rule starts executing

* Add in alertId

* Add more logging and fix tests

* Use existing startTiming logic

* Add additional tests
@chrisronline chrisronline deleted the alerting/rule_execution_starts branch June 17, 2021 19:02
chrisronline added a commit that referenced this pull request Jun 17, 2021
…#102558)

* Add event log entry when a rule starts executing

* Add in alertId

* Add more logging and fix tests

* Use existing startTiming logic

* Add additional tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jun 18, 2021
…ets-tab

* 'master' of github.com:elastic/kibana: (93 commits)
  [ML] Remove blank job definition as it is unused and out-of-sync with Elasticsearch (elastic#102506)
  [Lens] Fix wrong error detection on transition to Top values operation (elastic#102384)
  [ML] Anomaly detection job custom_settings improvements (elastic#102099)
  [Cases] Route: Get all alerts attach to a case (elastic#101878)
  Fixes wrong list exception type when creating endpoint event filters list (elastic#102522)
  remove search bar that's not working yet (elastic#102550)
  Migrated Ingest Node Pipeline Functional Tests to use test_user (elastic#102409)
  [Maps] clean up feature editing name space to avoid conflicts with layer settings editing (elastic#102516)
  [canvas] Refactor Storybook from bespoke to standard configuration (elastic#101962)
  [Security Solution] adds wrapSequences method (RAC) (elastic#102106)
  [FTR] Stabilize SSLP functional tests (elastic#102553)
  [K8] Added `Inter` font files for new theme (elastic#102359)
  [Workplace Search] Convert Groups pages to new page template (elastic#102449)
  [DOC] Add experimental disclaimer to rollup jobs (elastic#95624)
  [Security Solution][Endpoint] Suppress some of the jest console.error noise created by endpoint list middelware (elastic#102535)
  [Fleet] Improve performance of Fleet setup (elastic#102219)
  [Alerting] Add event log entry when a rule starts executing (elastic#102001)
  [Fleet] Update docker image of registry used in integration tests (elastic#101911)
  [Asset Management] Osquery telemetry updates (elastic#100754)
  Converts saved object tagging to new management layout (elastic#102284)
  ...

# Conflicts:
#	x-pack/plugins/fleet/kibana.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Alerting] [o11y] Improve event log data to include when the rule execution starts

5 participants