-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SLO] Add support for document count to custom metric indicator #170913
[SLO] Add support for document count to custom metric indicator #170913
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@@ -132,7 +132,7 @@ export function MetricInput({ | |||
selectedOptions={ | |||
!!indexPattern && | |||
!!field.value && | |||
AGGREGATION_OPTIONS.some((agg) => agg.value === agg.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a bug while referencing the Timeslice Metric implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I guess it was ok because there was always a selected field (e.g. isClearable={false}) , but good find nonetheless
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
…d-doc-count-to-custom-metric
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it locally and looks good, great addition!

I have a few comments regarding validation, that are irrelevant with this PR. This PR is already approved.
Regarding equation validation, we only check valid characters, not whether the aggregation name is correct. I have a video with the user experience in this case.
Screen.Recording.2023-11-09.at.12.01.35.mov
I noticed the same behaviour in the custom threshold rule, and @maryam-saeidi created a ticket to improve Custom threshold rule equation validation. Do you think this is something we could easily fix in our SLO page? I guess we need to change the regular expression, but I don't know how. I was wondering, is it possible to stay at the SLO detail page until we get a success/failure result? Because now we are redirected to SLO lists page and then back to SLO detail page with the toast error.
Also for consistency reasons if you think we should change validation style similar to what Mary changed in this PR, feel free to do it or create a separate ticket. According to the new validation style, Aggregation A
shouldn't appear as red, only the dropdown.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and tested locally:
- create SLO with doc count
- Edit SLO with doc count -> sum and vice versa
- Edit SLO with error (form is populated back correctly)
🍒 Summary
This PR fixes #170905 by adding the aggregation menu to the Custom Metric indicator to allow the user to pick either
doc_count
orsum
for the aggregation.