POC: AI sprint week - Insights page - #1674
Draft
VikaCep wants to merge 19 commits into
Draft
Conversation
Add structured JSON actions to AI recommendations with Review/Confirm/Undo flow. New Alerting section with deterministic per-check alert setup using predefined defaults.
Sort checks by type by count descending. Show API reason for low-value checks. Fix failure logs link to filter by level=error. Cap tooltip lists at 10 items. Bump font sizes from bodySmall to body across sections.
Register a createTool that queries the SM metrics datasource with PromQL, passed to useInlineAssistant via the tools parameter. The assistant can now autonomously query per-probe success rates and latency during investigation instead of guessing from aggregated data. Improve system prompt to prevent hallucinated metric values.
Prevent assistant from hallucinating per-probe values by clarifying mean_success_rate semantics. Add reachability vs uptime distinction. Hint assistant to use the query tool for exact per-probe metrics.
Script size changes
Totals
|
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.
Summary
New Insights tab on the Home page that surfaces aggregated data from the
/sm/insightsAPI endpoint (built by @danieljimenez in the API repo). The page shows usage stats, performance warnings, alerting gaps, and recommendations -- with inline Grafana Assistant integration for AI-powered investigation and executable actions.What it does
Usage -- Cards showing check types, status, limits, probe distribution, and labels with linked filters.
Alerting -- Lists checks without alerts, sorted by severity (checks with performance issues first). Per-check "Set up" button proposes default alerts by check type, with individual or bulk apply.
Performance -- Paginated per-check rows for uptime warnings, flapping, latency degradation, and regional anomalies. Clicking a row opens an inline AI investigation that:
useInlineAssistant()createToolto query Prometheus for real per-probe metrics mid-investigationRecommendations -- Grouped cards for reducing frequency, consolidating overlapping targets, and cleaning up duplicates. Each card has:
AI integration patterns used
useInlineAssistant()withtoolsparameter for inline streaming + tool callingcreateTool()to register a Prometheus query tool the assistant calls autonomouslyjson:actionsblocks parsed from AI responses to render executable UI actionsInsightsPage.prompts.tsNote
This is not production-ready.
Screen.Recording.2026-05-06.at.6.04.40.PM.mov