Skip to content

feat: add grafana dashboards components#3891

Merged
forestileao merged 39 commits intosuperplanehq:mainfrom
WashingtonKK:feat/grafana-dashboards
Apr 16, 2026
Merged

feat: add grafana dashboards components#3891
forestileao merged 39 commits intosuperplanehq:mainfrom
WashingtonKK:feat/grafana-dashboards

Conversation

@WashingtonKK
Copy link
Copy Markdown
Collaborator

@WashingtonKK WashingtonKK commented Apr 1, 2026

Closes: #3886

This expands the grafana integration by adding the following dashboard focused actions:

  • grafana.searchDashboards (Action)
  • grafana.getDashboard (Action)
  • grafana.createDashboardShareLink (Action)
  • grafana.renderPanel (Action)

Demo Video


Note

Medium Risk
Adds new Grafana API surface (folders/dashboards/panels) and new workflow components that fetch dashboards and construct render URLs; also changes Query Data Source time inputs to expression-evaluated values, which could affect existing workflows’ time range behavior.

Overview
Adds dashboard-focused Grafana actions: a new grafana.getDashboard component that fetches dashboard metadata (including panel summaries) and a grafana.renderPanel component that builds Image Renderer URLs with optional time-range expressions.

Extends the Grafana client and resource picker support to list folders, search dashboards, and enumerate panels from a selected dashboard (including nested panels), while normalizing returned dashboard URLs to absolute.

Updates grafana.queryDataSource to use expression-based timeFrom/timeTo inputs and introduces shared time parsing/evaluation utilities (including handling Go time strings with monotonic suffixes), plus UI mappers/tests and docs to surface the new capabilities.

Reviewed by Cursor Bugbot for commit c020b59. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/client.go
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@WashingtonKK
Copy link
Copy Markdown
Collaborator Author

Screencast.from.2026-04-03.11-17-54.webm

Comment thread web_src/src/pages/workflowv2/mappers/grafana/search_dashboards.ts Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/search_dashboards.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
- Simplified event section creation in `dashboard_shared.ts` by consolidating timestamp handling and ensuring fallback values for event IDs.
- Enhanced `search_dashboards.ts` to include payload timestamps in details and refactored subtitle rendering to use React elements for better formatting.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/client.go Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
- Renamed "Panel ID" to "Panel" in various components and documentation for consistency.
- Enhanced the `CreateDashboardShareLink` and `RenderPanel` components to utilize the new panel handling.
- Updated metadata handling to include panel titles and labels.
- Added tests for retrieving dashboard panels and improved related mappers.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/search_dashboards.go Outdated
- Changed dashboard URLs in documentation and example output to use absolute paths instead of relative paths.
- Added a test to ensure that the client resolves relative URLs to absolute URLs correctly during dashboard searches.
- Updated the `SearchDashboards` method to resolve URLs for returned dashboard results.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
- Changed the dashboard URL in the example output to use an absolute path for better accessibility.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
- Updated the logic for determining the received timestamp in the `dashboard_shared.ts` file to ensure correct fallback behavior based on the legacy flag.
- This change improves the accuracy of event timestamps in Grafana dashboard mappings.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/create_dashboard_share_link.go Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
… range fields

- Modified the `CreateDashboardShareLink`, `QueryDataSource`, and `RenderPanel` components to utilize expression inputs for the "From" and "To" time range fields, enhancing flexibility in time range specification.
- Updated documentation to reflect the changes in time range input types and examples.
- Added tests to ensure the correct configuration of time range fields as expressions.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/get_dashboard.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/render_panel.go
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/render_panel.ts Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@AleksandarCole AleksandarCole added the pr:stage-3/3 Ready for full, in-depth, review label Apr 14, 2026
Comment thread pkg/integrations/grafana/query_data_source.go Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/dashboard_shared.ts Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/base.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/base.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/query_data_source.go Outdated
Comment thread web_src/src/pages/workflowv2/mappers/grafana/base.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/query_data_source.go
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9b50f51. Configure here.

Comment thread web_src/src/pages/workflowv2/mappers/grafana/base.ts
Comment thread pkg/integrations/grafana/render_panel.go
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@forestileao forestileao merged commit 61261b5 into superplanehq:main Apr 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:stage-3/3 Ready for full, in-depth, review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Grafana] Expand - Dashboards

3 participants