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] Implement federated views #178050

Merged
merged 161 commits into from
Apr 16, 2024
Merged

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Mar 5, 2024

Issue and documentation: https://github.com/elastic/observability-dev/issues/3045

Extra:
Closes #180194

🍒 Summary

This PR implements federated view, allowing a list of remote clusters to be used to fetch remote SLOs. These remote SLOs are shown on the SLO listing page next to the local SLOs.

Remote SLOs are fetched using the current space: Remote SLOs created on a specific space will only be displayed on the SLOs listing page of the same space in the overview cluster.

The SLO models evolved quite a bit recently, and our types were not representative anymore of this new model. I've introduced an SLODefinition type that represents an SLO when we define it and store it in the repository. And a SLOWithSummaryData type (bad name because summary is not the only thing we have now) that includes things like instanceId, groupings, summary and remote data that we add to the SLO definition.

🥼 Testing

Create an edge-lite-oblt cluster

Run oblt-cli cluster create ccs --remote-cluster=edge-lite-oblt

Use the kibana.yml file provided by robots but add the server path:

server.basePath: '/kibana'
server.publicBaseUrl: 'http://localhost:5601/kibana'
elasticsearch.ignoreVersionMismatch: true

Then run kibana locally normally: yarn kbn bootstrap && yarn start

Generate data in your oblt cluster

Use the ES credentials from the robot notification:

node x-pack/scripts/data_forge.js --events-per-cycle 3 --lookback now-7d --dataset fake_stack --install-kibana-assets --kibana-url http://localhost:5601/kibana --elasticsearch-host ES_HOST --elasticsearch-username admin --elasticsearch-password PASSWORD  --kibana-username admin --kibana-password PASSWORD

Create SLOs on edge-lite-oblt cluster

Create some SLO on the edge-lite-oblt cluster directly.

📓 Scenario

💡 Use different SLI type

on remote cluster:

  • Create SLO on remote under default space
  • Create SLO on remote under non-default space
  • Create SLO with groups on remote under default space
  • Create SLO with groups on remote under non-default space

on local cluster:

  • Create SLO under default space
  • Create SLO under non-default space
  • Create SLO with groups under default space
  • Create SLO with groups under non-default space

Checklist

  • Link to remote SLOs are space aware
  • Edit remote SLO links to remote cluster
  • Delete SLO links to remote cluster
  • Clone SLO links to remote cluster
  • Temporary remote SLOs are displayed correctly

to be continued

📺 Features

  • ✅ Display remote SLOs in the local list page (space aware)
  • ✅ Display remote SLO details from local cluster (space aware)
  • ✅ Good/Bad events chart only works for newly created/updated slos
  • ✅ Link to remote SLO cluster (space aware)
  • ✅ Remote SLOs actions redirect to remote cluster: Edit, Manage Burn Rate, Clone, Delete
  • ✅ All views handles Remote SLOs (card, table, compact table)
  • ✅ Group by remote clusters
  • ✅ Ability to configure used remote clusters vis settings page

🖼️ Screenshots

List Page List Page List Page List Page List Page
screencapture-localhost-5601-kibana-s-kevin-app-slos-2024-04-09-10_38_44 screencapture-localhost-5601-kibana-s-kevin-app-slos-2024-04-09-10_37_24 screencapture-localhost-5601-kibana-s-kevin-app-slos-2024-04-09-10_37_40 screencapture-localhost-5601-kibana-s-kevin-app-slos-2024-04-09-10_37_51 screencapture-localhost-5601-kibana-app-slos-2024-04-09-10_39_29
Remote SLO Details Page Remote SLO with Group Details Page
screencapture-localhost-5601-kibana-app-slos-934099c1-ffdb-4f24-82b5-55a7ad3eb183-2024-04-09-10_40_17 screencapture-localhost-5601-kibana-s-kevin-app-slos-36b91514-7994-4c54-84fc-98a1b6a95934-2024-04-09-10_41_10
Settings Page
image

Follow-ups

📋 Tasks to wrap up

  • For “View Events” feature, we should send the discover link to the remote OR disable it.
  • Handle the remote of a remote situation with get_preview_data (Events chart)
  • Hide the 0 label on the alerts tab for the remote and disable the tab with a tooltip.
  • The action menu on the compact view isn’t following the same logic as the action menus on the card and expanded list view.
  • For Tags and Status on Remotes, they don’t show up in the tag and status filter bar
  • Fix summary document without latest change
  • Ability to create burn rate rules on a federated SLO
  • Kibana remote URL is not working with space other than "default"
  • Ability to add a Federated SLO to a Dashboard
  • The banner below should span the page, this is because the column of the actions should only be applied to the title content and not the banner.
    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!)

@shahzad31 shahzad31 changed the title poc(slo): federated views [SLO] Implement federated views Mar 11, 2024
@shahzad31 shahzad31 marked this pull request as ready for review March 11, 2024 09:22
@shahzad31 shahzad31 requested review from a team as code owners March 11, 2024 09:22
@shahzad31 shahzad31 added the release_note:skip Skip the PR/issue when compiling release notes label Mar 11, 2024
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Mar 11, 2024
@elasticmachine
Copy link
Contributor

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

@dominiqueclarke
Copy link
Contributor

@dominiqueclarke

The view events feature does not work for histogram metric indicator. This is an SLO on the kevin space. I tested this for a remote SLO with custom kql indicator on default space, so it's unclear to me if this is a histogram metric issue or a space issue.

This issue is coming from the local kibana space that does not have the existing dataview with which the remote SLO was created. I guess the View Events link should redirect to the remote Kibana discover page instead. What do you think?

Yeah I think we should redirect to the remote ideally.

…tings/settings_form.tsx

Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
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.

LGTM

Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

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

I created a spaced called Kevin, then tried to save the settings and I ended up with this error:

image

@kdelemme kdelemme force-pushed the poc/federated-views branch from b702e46 to d8bf376 Compare April 15, 2024 20:48
@kdelemme
Copy link
Contributor Author

@simianhacker Fixed d8bf376

Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes!

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM 🎆

Great work !!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
slo 706 716 +10

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/core-saved-objects-base-server-internal 181 182 +1
@kbn/slo-schema 165 170 +5
total +6

Async chunks

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

id before after diff
slo 697.9KB 713.1KB +15.2KB

Page load bundle

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

id before after diff
observability 150.3KB 150.4KB +85.0B
slo 21.8KB 21.9KB +105.0B
total +190.0B
Unknown metric groups

API count

id before after diff
@kbn/core-saved-objects-base-server-internal 224 225 +1
@kbn/slo-schema 165 170 +5
total +6

History

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

cc @simianhacker

@kdelemme kdelemme merged commit 721d354 into elastic:main Apr 16, 2024
21 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 16, 2024
@kdelemme kdelemme deleted the poc/federated-views branch April 16, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team 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] The status labels in the compact view are not centered.