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] Enable burn rate alert by default during creation via UI #176317

Merged
merged 9 commits into from
Feb 7, 2024

Conversation

simianhacker
Copy link
Member

Summary

This PR changes the SLO creation behavior via the UI. Instead of having a checkbox to create the Burn Rate rule, with this PR, the Burn Rate Rule will be created by default. The Burn Rate rule is only created by default when using the UI, the create SLO API does not create a rule by default.

- Adds useCreateRule hooks
- Updates createWindow to use CreateSLOInput
- Creates rule when SLO is created via UI
@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 marked this pull request as ready for review February 6, 2024 16:28
@simianhacker simianhacker requested a review from a team as a code owner February 6, 2024 16:28
@elasticmachine
Copy link
Contributor

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

@paulb-elastic
Copy link
Contributor

Does the flow risk that burn rate rules will be created without connectors? Should this be called out somehow?

Comment on lines 25 to 29
const ruleId = v4();
const body = JSON.stringify(rule);
return http.post(`${http.basePath.prepend(BASE_ALERTING_API_PATH)}/rule/${ruleId}`, {
body,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think we should be calling another plugin public API.
We should create a route and use AlertingClient exposed on server side to create an alert.

Copy link
Member Author

Choose a reason for hiding this comment

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

@XavierM thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's public, it should be ok to use them. We use at least 2 other RAC apis for fetching the rules and alerts.

@dedemorton
Copy link
Contributor

It sounds like this change has a small impact on the documentation here. Can you open a docs issue or--if you feel inclined--open a docs PR to make sure the docs get updated? Thanks!

Comment on lines +89 to +97
updateSlo({ sloId: slo.id, slo: processedValues });
navigate(basePath.prepend(paths.observability.slos));
} else {
const processedValues = transformCreateSLOFormToCreateSLOInput(values);

if (isCreateRuleCheckboxChecked) {
const { id } = await createSlo({ slo: processedValues });
navigate(
basePath.prepend(`${paths.observability.sloEdit(id)}?${CREATE_RULE_SEARCH_PARAM}=true`)
);
} else {
createSlo({ slo: processedValues });
navigate(basePath.prepend(paths.observability.slos));
}
const resp = await createSlo({ slo: processedValues });
await createBurnRateRule({
rule: createBurnRateRuleRequestBody({ ...processedValues, id: resp.id }),
});
navigate(basePath.prepend(paths.observability.slos));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice simplification

Comment on lines -247 to -251
<BurnRateRuleFlyout
slo={slo as GetSLOResponse}
isAddRuleFlyoutOpen={isAddRuleFlyoutOpen}
canChangeTrigger={false}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

We can know add the form into a flyout without much difficulty 👏🏻

@simianhacker
Copy link
Member Author

@paulb-elastic We decided via Slack to go ahead and create the rule without connectors:

@grabowskit said:

I think it would be a mistake to create actions with a default alert rule. There is too many variables. I think it works best to create the alert rule, and let users edit it later to add actions later. I considered the idea of notifying users which alert rules don't have a connector, but it is probably unnecessary. Let's see what the user feedback looks like 🙂

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.

Tested locally and work as expected

@simianhacker simianhacker enabled auto-merge (squash) February 6, 2024 22:59
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 594 595 +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 625.6KB 634.7KB +9.1KB

History

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

@simianhacker simianhacker merged commit ca525c0 into elastic:main Feb 7, 2024
27 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 7, 2024
jloleysens added a commit that referenced this pull request Feb 7, 2024
* main: (224 commits)
  [Http] Replace `buildNr` with `buildSha` in static asset paths (#175898)
  [Ops] Fix GCS bucket access for future buildkite agents (#174756)
  [api-docs] 2024-02-07 Daily api_docs build (#176362)
  skip flaky suite (#176002)
  skip failing es promotion suite (#176359)
  [Cloud Security] [Grouping] Add URL Params support to the grouping components (#175749)
  chore(NA): update versions after v8.12.2 bump (#176309)
  chore(NA): update versions after v7.17.19 bump (#176313)
  skip failing test suite (#176352)
  [SLO] Enable burn rate alert by default during creation via UI (#176317)
  [Fleet] Add the uptime capability to observability projects (#176285)
  [Security Solution][Endpoint] Fix Manifest Manger so that it works with large (>10k) (#174411)
  [ResponseOps] Alert creation delay based on user definition (#175851)
  [data views] Default field formatters based on field meta values (#174973)
  [Cloud Security]Detection Rules counter on Rules Flyout (#176041)
  [Security Solution] Data Quality Dashboard persistence (#175673)
  [Ent Search] Connector client copy cleanup (#176290)
  [ML] Anomaly Detection: Adds actions menu to anomaly markers in Single Metric Viewer chart. (#175556)
  [ML] Anomaly Detection: Fix `values-dots` colors (#176303)
  [Fleet] Logstash Output - being compliant to RFC-952 (#176298)
  ...
fkanout pushed a commit to fkanout/kibana that referenced this pull request Feb 7, 2024
…ic#176317)

## Summary

This PR changes the SLO creation behavior via the UI. Instead of having
a checkbox to create the Burn Rate rule, with this PR, the Burn Rate
Rule will be created by default. The Burn Rate rule is only created by
default when using the UI, the create SLO API does not create a rule by
default.
@paulb-elastic
Copy link
Contributor

It sounds like this change has a small impact on the documentation here. Can you open a docs issue or--if you feel inclined--open a docs PR to make sure the docs get updated? Thanks!

Thank you for the prompt @dedemorton I've raised elastic/observability-docs#3600 for this

CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…ic#176317)

## Summary

This PR changes the SLO creation behavior via the UI. Instead of having
a checkbox to create the Burn Rate rule, with this PR, the Burn Rate
Rule will be created by default. The Burn Rate rule is only created by
default when using the UI, the create SLO API does not create a rule by
default.
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…ic#176317)

## Summary

This PR changes the SLO creation behavior via the UI. Instead of having
a checkbox to create the Burn Rate rule, with this PR, the Burn Rate
Rule will be created by default. The Burn Rate rule is only created by
default when using the UI, the create SLO API does not create a rule by
default.
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…ic#176317)

## Summary

This PR changes the SLO creation behavior via the UI. Instead of having
a checkbox to create the Burn Rate rule, with this PR, the Burn Rate
Rule will be created by default. The Burn Rate rule is only created by
default when using the UI, the create SLO API does not create a rule by
default.
@simianhacker simianhacker deleted the burn-rate-rule-by-default branch April 17, 2024 15:39
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:obs-ux-management Observability Management User Experience Team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants