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

[SLO] Add support for document count to custom metric indicator #170913

Conversation

simianhacker
Copy link
Member

🍒 Summary

This PR fixes #170905 by adding the aggregation menu to the Custom Metric indicator to allow the user to pick either doc_count or sum for the aggregation.

image

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@simianhacker simianhacker added Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" Feature:SLO Team:obs-ux-management Observability Management User Experience Team v8.12.0 release_note:enhancement labels Nov 8, 2023
@@ -132,7 +132,7 @@ export function MetricInput({
selectedOptions={
!!indexPattern &&
!!field.value &&
AGGREGATION_OPTIONS.some((agg) => agg.value === agg.value)
Copy link
Member Author

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

Copy link
Contributor

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

@simianhacker simianhacker marked this pull request as ready for review November 8, 2023 22:10
@simianhacker simianhacker requested a review from a team as a code owner November 8, 2023 22:10
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@mgiota mgiota self-requested a review November 8, 2023 23:01
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

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/slo-schema 126 128 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 1.1MB 1.1MB +1.9KB
Unknown metric groups

API count

id before after diff
@kbn/slo-schema 129 131 +2

History

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

cc @simianhacker

Copy link
Contributor

@mgiota mgiota left a 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!

Screenshot 2023-11-09 at 12 04 03

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.

Screenshot 2023-11-09 at 12 28 01

@kdelemme kdelemme self-requested a review November 9, 2023 14:01
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.

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)

@simianhacker
Copy link
Member Author

@mgiota I created an issue to track the validation improvements for the custom equation: #170962

@simianhacker simianhacker merged commit b9c08ba into elastic:main Nov 9, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 9, 2023
@simianhacker simianhacker deleted the issue-170905-add-doc-count-to-custom-metric branch April 17, 2024 15:38
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 Feature:SLO release_note:enhancement Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" Team:obs-ux-management Observability Management User Experience Team v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Add document count to "Custom Metric" SLI
7 participants