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

[Metrics UI] Threshold alert redundant groupBy throws a false positive on OR matches #116195

Closed
Zacqary opened this issue Oct 25, 2021 · 2 comments · Fixed by #116695 or #116822
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@Zacqary
Copy link
Contributor

Zacqary commented Oct 25, 2021

Screen Shot 2021-10-25 at 1 29 58 PM

This shouldn't happen. The user should only be seeing this warning for something like host.name: host-1.

We can fix this by changing the redundant groupBy check: https://github.com/Zacqary/kibana/blob/master/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx#L263-L283

to use:

pattern: new RegExp(`{"match(_phrase)?":{"${group}":"(.*?)"}}`, "g");
// Add the "g" flag for a global search in order to count matches

and using alertParams.filterQuery.match(pattern).length === 1 instead of pattern.test(alertParams.filterQuery) as the boolean.

@Zacqary Zacqary added bug Fixes for quality problems that affect the customer experience Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Oct 25, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@Zacqary
Copy link
Contributor Author

Zacqary commented Nov 3, 2021

As per discussion on PR #116822, AC for this issue is NOT to update the logic to avoid these false positives, but to continue to display the warning and link to new documentation about groupBy.

The user may still need to be warned about using OR logic in their filterQuery, as they may not realize that this will limit their rule to only two groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
2 participants