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

[Metric threshold rule] Adds new context variable for group by keys #145654

Merged
merged 10 commits into from
Nov 24, 2022

Conversation

benakansara
Copy link
Contributor

@benakansara benakansara commented Nov 18, 2022

Summary

Closes #141496

Adds new context variable called groupByKeys which holds object of group by keys for Metric threshold rule.

Manual Testing

  1. Create Metric threshold rule with group by e.g. host.name, host.network.name
  2. Define action template with context.groupByKeys
  3. Wait for alerts to be generated
  4. Notice the group by object to be included in the alert notification

Screenshot 2022-11-21 at 12 27 20

Checklist

@benakansara benakansara marked this pull request as ready for review November 21, 2022 11:44
@benakansara benakansara requested a review from a team as a code owner November 21, 2022 11:44
@benakansara benakansara added release_note:feature Makes this part of the condensed release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.7.0 labels Nov 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

@benakansara benakansara requested a review from a team November 22, 2022 10:43
@jennypavlova jennypavlova self-requested a review November 23, 2022 11:53
Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

LGTM on the Metrics Explorer page - I was able to create a rule there, see the alerts and see the groupByKeys in the rules_types response. Please let me know if there is anything else I need to check there.

@benakansara
Copy link
Contributor Author

LGTM on the Metrics Explorer page - I was able to create a rule there, see the alerts and see the groupByKeys in the rules_types response. Please let me know if there is anything else I need to check there.

Great, by rules_types response, do you mean alert notification? Then that's enough.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 443 449 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 520 526 +6
total +21

History

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

Copy link
Contributor

@kdelemme kdelemme left a comment

Choose a reason for hiding this comment

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

Tested locally and work as expected 👍🏻 Good job @benakansara

@benakansara benakansara merged commit 746774f into elastic:main Nov 24, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 24, 2022
@benakansara benakansara deleted the feat/context-group-str-to-obj branch November 24, 2022 21:38
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 28, 2022
* main: (30 commits)
  [Cloud Posture] test latest findings table sort (elastic#144668)
  [api-docs] 2022-11-28 Daily api_docs build (elastic#146359)
  [api-docs] 2022-11-27 Daily api_docs build (elastic#146353)
  [api-docs] 2022-11-26 Daily api_docs build (elastic#146350)
  [DataViews] Fix form validation UX when the same data view name already exists (elastic#146126)
  [Discover] Prevent agg based visualizations of Discover saved objects with adhoc data views (elastic#145583)
  [Health Gateway] Update response aggregation (elastic#145761)
  [api-docs] 2022-11-25 Daily api_docs build (elastic#146341)
  [Metric threshold rule] Adds new context variable for group by keys (elastic#145654)
  [Controls] [Portable Dashboards] Add control group renderer example plugin (elastic#146189)
  Refactor Observability Overview Page (elastic#146182)
  Send complete test data to xMatters, so it can create an alert (elastic#145431)
  [Dashboard] [Controls] Allow options list suggestions to be sorted (elastic#144867)
  Add open API specification for list connector types (elastic#145951)
  skip flaky suite (elastic#146086)
  [ML] Removing duplicate tooltip text (elastic#146308)
  Refactor Rules Page (elastic#146193)
  [DOCS] Alert limit for cases (elastic#145950)
  Extend session index fields mapping with a session creation timestamp. (elastic#145997)
  [Files] Move <Image /> component to `@kbn/shared-ux` package (elastic#145995)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.7.0
Projects
None yet
6 participants