Skip to content

[SLO] Add AI-powered auto-discover SLOs feature#253278

Open
drewpost wants to merge 4 commits intoelastic:mainfrom
drewpost:slo/ai-auto-discover-slos
Open

[SLO] Add AI-powered auto-discover SLOs feature#253278
drewpost wants to merge 4 commits intoelastic:mainfrom
drewpost:slo/ai-auto-discover-slos

Conversation

@drewpost
Copy link

Summary

Adds a new Auto-discover creation mode to the SLO creation page that scans the user's cluster data and uses AI to propose user-centric SLOs following SRE best practices.

  • Cluster data discovery: Scans APM services, synthetics monitors, log streams, and metric indices to build a summary of available data sources
  • AI-powered SLO proposals: Sends the cluster summary to an LLM via the inference plugin with a specialized prompt that prioritizes user-facing reliability (availability > latency > uptime > error logs)
  • Bulk SLO creation: One-click creation of all selected SLOs with per-SLO success/failure reporting

New API endpoints

Endpoint Description
POST /internal/slo/ai/discover Scans cluster data and proposes SLOs via AI
POST /internal/slo/ai/bulk-create Creates multiple SLOs at once
POST /internal/slo/ai/generate Converts NL prompt to structured SLO definition
POST /internal/slo/ai/suggest Suggests improvements for an SLO definition

User flow

  1. Navigate to Create new SLO (/app/slos/create)
  2. Click the Auto-discover toggle (alongside Manual and AI-assisted)
  3. Click Scan cluster & discover SLOs
  4. AI analyzes cluster data and proposes SLOs (Critical/High priority pre-selected)
  5. Review proposals — each card shows indicator type, target, time window, service, priority badge, category badge, and AI rationale
  6. Toggle selections as needed (select all / deselect all available)
  7. Click Create N SLOs to bulk-create all selected
  8. Redirected to SLO list with success notification

Files changed

18 files changed (~2,970 lines added)

Server (6 new files):

  • server/services/ai/slo_generation_prompt.ts — System prompts and output schemas for generate, suggest, and discover
  • server/services/ai/get_default_connector.ts — Default AI connector resolution (UI settings → inference plugin EIS fallback)
  • server/routes/slo/ai_discover_slos.ts — Discovery route with cluster scanning + LLM proposals
  • server/routes/slo/ai_bulk_create_slos.ts — Bulk create route using createSLOParamsSchema
  • server/routes/slo/ai_generate_slo.ts — NL generation route
  • server/routes/slo/ai_suggest_slo.ts — Suggestion route

Client (10 new files, 2 modified):

  • public/hooks/use_discover_slos.ts — React Query mutation for discovery
  • public/hooks/use_bulk_create_slos.ts — React Query mutation for bulk create
  • public/hooks/use_generate_slo.ts — React Query mutation for NL generation
  • public/hooks/use_suggest_slo.ts — React Query mutation for suggestions
  • public/pages/slo_edit/components/nl_slo/creation_mode_toggle.tsx — Three-way toggle
  • public/pages/slo_edit/components/nl_slo/slo_discover_form.tsx — Main auto-discover UI
  • public/pages/slo_edit/components/nl_slo/discovered_slo_card.tsx — Individual proposal card
  • public/pages/slo_edit/components/nl_slo/nl_slo_form.tsx — NL generation form
  • public/pages/slo_edit/components/nl_slo/slo_preview.tsx — SLO definition preview
  • public/pages/slo_edit/components/nl_slo/slo_suggestions.tsx — AI suggestions display
  • public/pages/slo_edit/slo_edit.tsx — Integrated all creation modes
  • server/routes/slo/route.ts — Registered all AI routes

Dependencies

  • Requires the inference plugin (optional dependency)
  • Uses the default AI connector (EIS preferred, falls back to OpenAI/first available)

Test plan

  • Navigate to /app/slos/create and verify the three-way toggle appears
  • Click "Auto-discover" and verify the scan prompt appears
  • Click "Scan cluster & discover SLOs" with APM data in the cluster
  • Verify proposals appear with priority badges, category badges, and rationale
  • Test select all / deselect all controls
  • Click "Create N SLOs" and verify SLOs are created successfully
  • Verify navigation to SLO list after creation
  • Test with no data in cluster — should show "No SLOs discovered" warning
  • Test "AI-assisted" mode — verify NL generation and refinement work
  • Verify error handling when no AI connector is configured

Made with Cursor

@drewpost drewpost requested a review from a team as a code owner February 16, 2026 14:31
@cla-checker-service
Copy link

cla-checker-service bot commented Feb 16, 2026

💚 CLA has been signed

@elasticmachine
Copy link
Contributor

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

@drewpost drewpost force-pushed the slo/ai-auto-discover-slos branch 3 times, most recently from eaa47b4 to 592f135 Compare February 16, 2026 15:24
drewpost and others added 4 commits February 16, 2026 16:54
Adds a new "Auto-discover" creation mode that scans cluster data (APM
services, synthetics monitors, log streams, metric sources) and uses AI
to propose user-centric SLOs. Users review proposals and create them
with one click.

Bulk creation uses client-side batching (5 SLOs per batch) with
progress tracking to avoid transform startup timeouts on large clusters.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drewpost drewpost force-pushed the slo/ai-auto-discover-slos branch from 90f611d to dedd61e Compare February 16, 2026 16:54
@drewpost drewpost added backport:skip This PR does not require backporting release_note:enhancement labels Feb 16, 2026
@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 16, 2026

💔 Build Failed

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
slo 1386 1396 +10

Async chunks

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

id before after diff
slo 1.1MB 1.1MB +28.1KB

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants