feat: SLO integration drawer with create, link, delete, and query-match banners - #1669
Draft
ckbedwell wants to merge 14 commits into
Draft
feat: SLO integration drawer with create, link, delete, and query-match banners#1669ckbedwell wants to merge 14 commits into
ckbedwell wants to merge 14 commits into
Conversation
Adds a "Create a SLO" button to the check detail dashboard that opens the grafana-slo-app wizard pre-populated with the check's job/target metrics.
Script size changes
Totals
|
…ginFunctions Centralise app-plugin availability detection in ExternalDependenciesProvider (isAppPluginInstalled per dependency, testable via overrides). Wire SLO linkage through grafana-slo-app/slo-api/v1 function extension instead of direct getBackendSrv calls, consuming the wrapped dispatch API (Option B). Add LinkedSlosIndicator to check dashboard header showing linked SLO count. Improve CreateSLOButton with drawer, labels, and initialValues contract.
…t and burn rate Drop the default SLO component in favour of a custom SloDetailTab that queries SLO recording rules (grafana_slo_success_rate_5m, grafana_slo_sli_5m, grafana_slo_objective) directly via the Prometheus API. The new component shows three threshold-coloured stat cards (SLI, Remaining Error Budget, Current Burn Rate) alongside the existing target/window metadata, labels and action buttons. The title heading is removed as it is redundant with the drawer tab label.
…to SLO drawer Add ability to link SLOs to checks via sm_check_id, delete SLOs with confirmation, and distinguish between unlinked query matches and SLOs linked to a different check. Filter out SLOs with deleting status.
SLO is an acronym (Service Level Objective) and should be written as SLO, not Slo. Renames 11 files, all types/interfaces, exported functions, local variables, and hook return wrappers to use the uppercase form. External grafana-slo-app plugin API keys (getSlos, updateSlo, deleteSlo) are preserved as-is since they are an external contract. Documents the convention in AGENTS.md.
Drop the sm_check_id label-based linkage in favour of a query-matcher-only approach using a global bidirectional link map (SLOCheckLinkMap). This fetches all SLOs and checks once, joins them via PromQL parsing, and exposes thin hooks (useSLOsForCheck, useChecksForSLO) for consumers. - Rename useSmCheckSLOs.* to useSLOCheckLinks.* per AGENTS.md casing - Add buildSLOCheckLinkMap pure function with table-driven tests - Extract useAllSLOs, useSLOCheckLinkMap, useUpdateSLO, useDeleteSLO - Remove sm_check_id from wizard labels and SLO creation flow - Migrate SLOIntegration.tsx to the new hooks - Remove banner UI for dual-source-of-truth linkage status - Delete unused label-based utilities (filterSLOsByLabel, isSLOLinkedByLabel, linkSLOToCheck, getMatchingSLOsForSMCheck)
Contributor
|
Is this one ready to review? |
Signed commits report8 of 14 commits between
This repository requires all commits to be signed. See GitHub docs on commit signature verification. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Users have no way to manage SLOs associated with their Synthetic Monitoring checks from within the SM app. They must navigate to the separate SLO app to create, view, link, or delete SLOs — even when the SLO clearly belongs to a specific check. Additionally, SLOs matched only by query (job label) have no way to be explicitly linked to a check, and SLOs linked to a different check can appear under the wrong check with no warning.
Solution
Adds a full SLO integration drawer accessible from each check's dashboard header:
sm_check_idlabel), a banner prompts the user to explicitly link it. A second banner variant warns when an SLO is linked to a different check but query-matches the current one.deleteSloAPI. SLOs withreadOnly.status.type === 'deleting'are filtered out immediately so the count and drawer reflect the deletion.All features are wired through the
grafana-slo-app/slo-api/v1extension point usingusePluginFunctionsand managed via React Query for caching and invalidation.Testing
Integration tests cover:
updateSloand invalidating queriesdeleteSloand invalidating queriesgetMatchingSlosForSmCheckfiltering out deleting SLOslinkSloToCheckstrippingreadOnlyand settingsm_check_id