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

New slo plugin #177937

Merged
merged 86 commits into from
Mar 19, 2024
Merged

New slo plugin #177937

merged 86 commits into from
Mar 19, 2024

Conversation

mgiota
Copy link
Contributor

@mgiota mgiota commented Mar 4, 2024

Fixes #176420

🍒 Summary

This PR copies the SLO code that was inside the Observability app into its own app under observability-solution/slo folder.

Screen.Recording.2024-03-09.at.00.45.40.mov

✔️ Acceptance criteria

  • URL of new app: app/slos
  • Design and functionality are not changed.
  • Git history has been retained for all files in x-pack/plugins/observability_solution/slo.
  • SLO should appear on server less
  • SLO code inside observability_solution/observability code has been removed. A new clean up round might be needed though for possible leftovers.
  • Burn rate rule is registered within the new slo app
  • SLO embeddables are moved inside the new slo app
    • overview
    • alerts embeddable
    • error budget burn down
  • Alerts table configuration registration for slo details page and alerts table embeddable is still done in the observability app. Response Ops team is working on removing the need to register the alert table anyway
  • Slo app is wrapped into ApplicationUsageTrackingProvider which will send slo Application usage information tracked by the slo appId
  • Redirect old app/observability/slos route to app/slos
  • Rename old xpack.observability.slo keys to xpack.slo in the translation files

🌮 How to test

Design and functionality didn't change, so simply navigate to existing slo pages and try to break it

  • Slo list page
    • group by
    • unified search
    • toggle buttons
    • actions
  • Slo creation
    • try group by as well
  • Slo detail page
    • Actions on top
    • navigate to overview and alerts tabs
  • Create SLO flyout in Logs Explorer
  • Create burn rate rules and verify they appear on rules page
  • Verify SLO alerts appear on Alerts page and slo details page
  • Embeddables
    • Through the dashboard app
    • Using the attach to dashboard action on the slo card item on slo list page and the error budget burn down chart on the slo detail page
  • SLOs only for platinum users
  • Permissions
  • Spaces

TODO

  • Move slo stuff from observability folder to new slo plugin
  • Remove old slo stuff from observability folder
  • Update references
  • Fix typescript and eslint errors
  • Paths
  • Locators
  • Burn rate rule registration
  • Embeddable Alerts table configuration registration
  • Embeddables
  • Translations
  • Verify plugin.ts files contain all registration logic
    • public
    • server
  • Final cleanup for observability folder
  • Run tests
  • Application Usage (Telemetry)
  • Permissions

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

Copy link
Contributor

github-actions bot commented Mar 4, 2024

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@mgiota mgiota force-pushed the new_slo_plugin branch 2 times, most recently from 997721d to 0ab9dda Compare March 5, 2024 16:58
@mgiota mgiota force-pushed the new_slo_plugin branch 10 times, most recently from 8368ce0 to 513ab04 Compare March 6, 2024 20:32
Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

Changes to observability navigation_tree.ts LGTM 👍

@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@elasticmachine merge upstream

@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@CoenWarmer regarding handling redirection of the old slo detail and edit pages, here's what I've done and works fine. If you know any other better out of the box solution, just let me know

Screen.Recording.2024-03-18.at.13.30.38.mov

@@ -155,4 +159,18 @@ export const routes = {
params: {},
exact: true,
},
[OLD_SLO_DETAIL_PATH]: {
handler: () => {
return <SimpleRedirect to="/:sloId" redirectToApp="slo" />;
Copy link
Contributor

@CoenWarmer CoenWarmer Mar 18, 2024

Choose a reason for hiding this comment

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

Don't you need something before /:sloId? How does the <SimpleRedirect /> component distinguish between the edit and detail route? The to prop is the same in both cases?

Copy link
Contributor Author

@mgiota mgiota Mar 18, 2024

Choose a reason for hiding this comment

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

@CoenWarmer I handle both edit and detail routes in this condition, which takes out the /slos part from the url and keeps /edit/1234 or /1234 accordingly:

if (to === '/:sloId') {
      to = pathname.split('/slos')[1];
    }

Initially I added this condition just for the detail path, but then it worked out well for the edit as well. What do you think? I agree not the most elegant way. I am wondering if React router has something out of the box, that you are aware of.

@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@elasticmachine merge upstream

@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@elasticmachine merge upstream

@dominiqueclarke dominiqueclarke self-requested a review March 18, 2024 15:41
@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@elasticmachine merge upstream

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

Smoke tests LGTM

@mgiota
Copy link
Contributor Author

mgiota commented Mar 18, 2024

@elasticmachine merge upstream

@mgiota mgiota enabled auto-merge (squash) March 18, 2024 23:02
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Entity Analytics - Security Cypress Tests #1 / Entity Analytics Dashboard legacy risk score With user risk data With alerts data filters the alerts count with time range filters the alerts count with time range

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 890 474 -416
observabilityShared 181 193 +12
slo - 610 +610
total +206

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
observability 642 652 +10
observabilityShared 325 328 +3
slo - 61 +61
total +74

Async chunks

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

id before after diff
observability 902.1KB 258.7KB -643.4KB
observabilityLogsExplorer 153.1KB 153.0KB -20.0B
slo - 614.4KB ⚠️ +614.4KB
total -29.0KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
alerting 51 53 +2
observability 17 14 -3
slo - 1 +1
total -0

Page load bundle

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

id before after diff
observability 108.7KB 150.0KB +41.3KB
observabilityLogsExplorer 15.6KB 15.5KB -143.0B
observabilityShared 61.1KB 61.5KB +360.0B
serverlessObservability 26.6KB 26.7KB +64.0B
slo - 20.7KB +20.7KB
total +62.3KB
Unknown metric groups

API count

id before after diff
observability 651 661 +10
observabilityShared 330 333 +3
slo - 61 +61
total +74

async chunk count

id before after diff
observability 35 12 -23
slo - 24 +24
total +1

ESLint disabled in files

id before after diff
observability 5 4 -1
slo - 2 +2
total +1

ESLint disabled line counts

id before after diff
observability 40 33 -7
slo - 12 +12
total +5

miscellaneous assets size

id before after diff
observability 695.2KB 161.8KB -533.4KB
slo - 695.2KB ⚠️ +695.2KB
total +161.8KB

References to deprecated APIs

id before after diff
observability 6 2 -4
slo - 4 +4
total -0

Total ESLint disabled count

id before after diff
observability 45 37 -8
slo - 14 +14
total +6

History

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

cc @mgiota

@mgiota mgiota merged commit d5dfee7 into elastic:main Mar 19, 2024
36 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 19, 2024
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:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Migrate slo under its very own plugin