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

[OBS-UX-MNGMT] - Add P95, P99, and RATE Aggs to the Custom Threshold rule #173728

Conversation

fkanout
Copy link
Contributor

@fkanout fkanout commented Dec 20, 2023

Summary

Fixes #172945 by adding P95, P99, and RATE Aggs to the Custom Threshold rule

Screenshot 2023-12-20 at 12 31 50 Screenshot 2023-12-20 at 12 31 57 Screenshot 2023-12-20 at 12 36 16

@fkanout fkanout requested a review from a team as a code owner December 20, 2023 11:39
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Dec 20, 2023
@elasticmachine
Copy link
Contributor

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

@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!)

@fkanout fkanout added Feature:Alerting Feature: Custom threshold Observability custom threshold rule type v8.13.0 labels Dec 20, 2023
@fkanout fkanout self-assigned this Dec 20, 2023
@fkanout fkanout added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Dec 20, 2023
Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

I tried to create a rule and I got this error:

Looking at the code, I don't see adding these new aggregations to the executor.

@simianhacker I remember you were talking about some minor differences between these aggregations and the rest. Would you please share those differences to ensure we check them during the PR review?

It would be good to add an API integration test for one of these integration (Maybe the one that has more differences based on Chris's input)

Copy link
Contributor Author

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

Checking the commits, it seems there is a divergence. Woking on fixing it

@fkanout
Copy link
Contributor Author

fkanout commented Dec 28, 2023

@elasticmachine merge upstream

@fkanout
Copy link
Contributor Author

fkanout commented Dec 28, 2023

I tried to create a rule and I got this error:

@maryam-saeidi, the allowed Aggs were hard coded. Fixed here https://github.com/elastic/kibana/pull/173728/files#diff-2c2365096901ec4d3f525f2de7671eee30ae3e61da3925c6c94d257b006ea71cR88

@fkanout
Copy link
Contributor Author

fkanout commented Jan 2, 2024

@elasticmachine merge upstream

@fkanout fkanout requested a review from maryam-saeidi February 5, 2024 14:03
export const lensFieldFormatter = (
metrics: CustomThresholdExpressionMetric[]
): typeof LensFieldFormat[keyof typeof LensFieldFormat] => {
if (metrics.length < 1 || !metrics[0].field) return LensFieldFormat.NUMBER;
Copy link
Member

Choose a reason for hiding this comment

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

Does it mean we will use the first metric's unit for the whole equation? Does it work for all the scenarios? (Not sure how we can check this.)

The safer option would be to only format when we have one metric but I cannot think of a scenario that this would create an issue. What do you think @simianhacker @maciejforcone @paulb-elastic?

Copy link
Contributor Author

@fkanout fkanout Feb 6, 2024

Choose a reason for hiding this comment

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

@maryam-saeidi I agree. We can go further. Even if we have more than one metric, we check if ALL have the same field type and then apply the format; otherwise, there is no format.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, if all the fields have the same formatter, then we format, otherwise leave it raw.

start: moment(timeframe.end).subtract(metricParams.timeSize, metricParams.timeUnit).valueOf(),
});
) => {
const isRateAgg = metricParams.metrics.some((metric) => metric.aggType === Aggregators.RATE);
Copy link
Member

Choose a reason for hiding this comment

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

Difference in seconds is related to lastPeriod (more info)

@fkanout fkanout requested a review from maryam-saeidi February 6, 2024 13:34
@fkanout fkanout enabled auto-merge (squash) February 6, 2024 13:45
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #25 / APM API tests correlations/latency.spec.ts trial 8.0.0 "before all" hook: runBefore in "8.0.0"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 595 596 +1

Async chunks

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

id before after diff
observability 634.7KB 635.6KB +957.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observability 101.9KB 102.0KB +83.0B

History

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

cc @fkanout

@fkanout fkanout merged commit ed2e3f8 into elastic:main Feb 7, 2024
18 checks passed
fkanout added a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
…rule (elastic#173728)

## Summary

Fixes elastic#172945 by adding P95, P99, and RATE Aggs to the Custom Threshold
rule

<img width="575" alt="Screenshot 2023-12-20 at 12 31 50"
src="https://github.com/elastic/kibana/assets/6838659/fd9f33fc-97c5-4cf8-b15e-3134048c861a">
<img width="565" alt="Screenshot 2023-12-20 at 12 31 57"
src="https://github.com/elastic/kibana/assets/6838659/56047c84-a6e5-4a8a-a05f-b6c1358a7297">
<img width="601" alt="Screenshot 2023-12-20 at 12 36 16"
src="https://github.com/elastic/kibana/assets/6838659/af7c291d-320f-4cb1-b62f-46e29f596bcd">
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…rule (elastic#173728)

## Summary

Fixes elastic#172945 by adding P95, P99, and RATE Aggs to the Custom Threshold
rule

<img width="575" alt="Screenshot 2023-12-20 at 12 31 50"
src="https://github.com/elastic/kibana/assets/6838659/fd9f33fc-97c5-4cf8-b15e-3134048c861a">
<img width="565" alt="Screenshot 2023-12-20 at 12 31 57"
src="https://github.com/elastic/kibana/assets/6838659/56047c84-a6e5-4a8a-a05f-b6c1358a7297">
<img width="601" alt="Screenshot 2023-12-20 at 12 36 16"
src="https://github.com/elastic/kibana/assets/6838659/af7c291d-320f-4cb1-b62f-46e29f596bcd">
fkanout added a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…rule (elastic#173728)

## Summary

Fixes elastic#172945 by adding P95, P99, and RATE Aggs to the Custom Threshold
rule

<img width="575" alt="Screenshot 2023-12-20 at 12 31 50"
src="https://github.com/elastic/kibana/assets/6838659/fd9f33fc-97c5-4cf8-b15e-3134048c861a">
<img width="565" alt="Screenshot 2023-12-20 at 12 31 57"
src="https://github.com/elastic/kibana/assets/6838659/56047c84-a6e5-4a8a-a05f-b6c1358a7297">
<img width="601" alt="Screenshot 2023-12-20 at 12 36 16"
src="https://github.com/elastic/kibana/assets/6838659/af7c291d-320f-4cb1-b62f-46e29f596bcd">
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:Alerting Feature: Custom threshold Observability custom threshold rule type release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom Threshold] Add rate and percentile aggs to the rule
8 participants