feat(monitoring): add Monitoring view mirroring concave-web - #1
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
feat(monitoring): add Monitoring view mirroring concave-web#1devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Adds a new Monitoring view to the Bubble Tea TUI that mirrors the Prometheus/Grafana surface now shipping in concave-web. - internal/monitoring: small HTTP prober that probes /-/healthy, /api/v1/status/buildinfo and /api/health, plus a Query() helper that reduces a PromQL vector to its first scalar sample. - cmd/concave-tui/config: new [monitoring] section with prometheus_url and grafana_url (empty by default; disables the view when both are blank). - cmd/concave-tui/model/monitoring.go: MonitoringModel, wired into RootModel between Fleet and Teams. Gracefully renders a guidance card when no URLs are configured, a badge per service with version info when reachable, and a PromQL snapshot (targets up, CPU busy, memory available, root filesystem free, GPU util). - Existing visibleViews-order tests updated for the new view index. - Unit tests cover reachability parsing, PromQL scalar extraction, error paths, and view rendering with a stubbed prober.
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Adds a Monitoring view to the Bubble Tea TUI that mirrors the Prometheus/Grafana surface now shipping in
concave-web(Gradient-Linux/concave-web#1). Business logic stays inconcave; the TUI only reads from upstream HTTP endpoints.New package —
internal/monitoringProberwithProbe(ctx)(reachability via/-/healthy+/api/v1/status/buildinfoand/api/health) andQuery(ctx, expr)(PromQL instant, reduced to first scalar sample).Configured:false; HTTP errors and decode failures propagate into theSample.Errorfield so the view can render them inline.internal/monitoring/monitoring_test.go.Config —
cmd/concave-tui/config[monitoring]TOML section withprometheus_url/grafana_url. Both default to empty; when both are empty the view renders a guidance card pointing at the config file and mentioning the Flow (:9090/:3000bundled) and Forge suites.TestMonitoringURLsRoundTrip.TUI —
cmd/concave-tui/modelMonitoringModelbetween Fleet and Teams in the sidebar. Viewer-gated, refresh-on-r, auto-refresh every 15 s.MN, labelMonitoring; shortcut shifted from8to9for System on admin sessions.TestRootSwitchesViewsWhenAuthenticated,TestAdminVisibleViewsIncludeSystemAndUsers,TestViewerVisibleViewsIncludeMonitoringScreens) updated to reflect the new view index — this is a direct consequence of the new sidebar entry, not a semantic change.monitoring_test.gocovers: guidance when unconfigured, reachability + PromQL rendering with a stubbed prober, unreachable-error rendering.No new dependencies.
go vet ./...andgo test ./...pass.Review & Testing Checklist for Human
Risk: yellow — adds a new sidebar entry (so view indices shift) and a new outbound HTTP path for probing Prometheus/Grafana, but both URLs are empty by default so the view is a no-op until the user opts in.
~/.config/concave-tui/config.toml— the existing[display]/[layout]content is untouched; a fresh[monitoring]block should be appended with empty URLs.prometheus_url = "http://127.0.0.1:9090"andgrafana_url = "http://127.0.0.1:3000", restart the TUI, switch to the Monitoring view (number7for viewers, ortab), and confirm the reachability badges flip toreachableand the PromQL rows populate.not configuredrather than erroring.Notes
SettingsModelas a follow-up if preferred.System(andUsers) shifts by one for admin sessions because the new view sits before them. The existingtab/shift+tabcycling continues to work as before.Link to Devin session: https://app.devin.ai/sessions/5d19efa113054ca4953d9ed9309ce705
Requested by: @ElFariss