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] Save the ECS group by fields at the AAD root level #188976

Conversation

maryam-saeidi
Copy link
Member

Related to #183220

Summary

This PR extracts getEcsGroups to a package to save ECS groups in the Alert As Data (AAD) document for the metric threshold rule.

🧪 How to test

  • Create a metric threshold rule with multiple groups (both ECS and non-ECS fields)
  • Check the related AAD document; you should be able to see the ECS fields at the root level and not see non-ECS fields there
  • Check the same information for the recovered alerts
  • Rules without group by should work as before

@maryam-saeidi maryam-saeidi added the release_note:skip Skip the PR/issue when compiling release notes label Jul 23, 2024
@maryam-saeidi maryam-saeidi self-assigned this Jul 23, 2024
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi
Copy link
Member Author

/ci

@maryam-saeidi maryam-saeidi marked this pull request as ready for review July 24, 2024 12:59
@maryam-saeidi maryam-saeidi requested review from a team as code owners July 24, 2024 12:59
@maryam-saeidi maryam-saeidi added the Team:obs-ux-management Observability Management User Experience Team label Jul 24, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

Obs Ux change LGTM

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 24, 2024
@@ -1622,25 +1622,6 @@ describe('The custom threshold alert type', () => {
});
await execute(COMPARATORS.GREATER_THAN, [0.9]);
const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
expect(services.alertsClient.setAlertData).toBeCalledTimes(1);
expect(services.alertsClient.setAlertData).toBeCalledWith({
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed as we don't need to provide the ECS groups for recovered alerts as the data is already in the alert document.

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

infra/tsconfig.json LGTM

@benakansara benakansara self-requested a review July 25, 2024 08:33
Copy link
Contributor

@benakansara benakansara 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 locally, everything worked as expected ✨

Left a question about InventoryMetricThresholdAlert.

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 25, 2024

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/observability-alerting-rule-utils - 5 +5
Unknown metric groups

API count

id before after diff
@kbn/observability-alerting-rule-utils - 5 +5

History

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

cc @maryam-saeidi

@maryam-saeidi maryam-saeidi enabled auto-merge (squash) July 25, 2024 15:02
@maryam-saeidi maryam-saeidi merged commit b17604d into elastic:main Jul 25, 2024
40 checks passed
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Jul 25, 2024
@maryam-saeidi maryam-saeidi deleted the 183220-add-ecs-groups-to-metric-threshold branch July 25, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants