feat: add grafana investigation components#3907
feat: add grafana investigation components#3907WashingtonKK wants to merge 25 commits intosuperplanehq:mainfrom
Conversation
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
|
👋 Commands for maintainers:
|
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
- Eliminated the timezone field from QueryDataSource, QueryLogs, and QueryTraces specifications and configurations. - Updated related documentation to clarify that datetime values are interpreted as UTC by default. - Adjusted tests to reflect the removal of the timezone requirement, ensuring proper handling of datetime picker values without explicit offsets. This change simplifies the configuration and usage of Grafana query components. Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
- Updated QueryLogs and QueryTraces components to support expr-golang values for time range specifications, allowing for more dynamic query configurations. - Introduced new tests to validate the use of expression placeholders for time fields in query configurations. - Added a new GetDataSourceNodeMetadata structure to encapsulate data source metadata, improving data handling in the GetDataSource integration. This change enhances the flexibility and usability of Grafana query components, making it easier for users to define time ranges in their queries. Signed-off-by: [Your Name] <your.email@example.com> Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
|
Let's just keep:
|
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
This commit deletes the GetDataSource and ListDataSources components, along with their associated test files and example output JSON files, streamlining the Grafana integration by removing obsolete code. Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
There was a problem hiding this comment.
we dont need to commit this file
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b249a6e. Configure here.
| componentName: string, | ||
| ): EventSection[] { | ||
| return grafanaEventSections(nodes, execution, componentName, "strict"); | ||
| } |
There was a problem hiding this comment.
Duplicate buildGrafanaEventSections function definitions in base.ts
High Severity
The diff adds a second export function buildGrafanaEventSections at line 97, but one already exists at line 14 with a different signature that accepts an optional 4th options?: BuildGrafanaEventSectionsOptions parameter. Multiple existing callers (create_alert_rule.ts, update_alert_rule.ts, get_alert_rule.ts) invoke it with 4 arguments including { strict: true }. The two implementations also have different behavior — the first uses resolveGrafanaEventDisplayTimestamp (which falls back to updatedAt), while the new one uses different timestamp handling via grafanaEventSections. This duplicate will cause a TypeScript compilation error, or if it somehow compiles, the shadowed version would silently drop the options argument from all existing callers.
Reviewed by Cursor Bugbot for commit b249a6e. Configure here.
| Timezone: stringPtr("2"), | ||
| }, | ||
| timezone: "GMT+2.0 (UTC+02:00)", | ||
| timezone: "GMT+02:00 (UTC+02:00)", |
There was a problem hiding this comment.
Unrelated schedule test changes accidentally committed
Low Severity
Changes to schedule_test.go (timezone format string updates like "GMT-5.0" → "GMT-05:00") are unrelated to the grafana investigation components feature. A reviewer already noted "we dont need to commit this file."
Reviewed by Cursor Bugbot for commit b249a6e. Configure here.


Closes: #3888
This expands the grafana integration by adding the following components:
Demo Video
Note
Medium Risk
Adds new Grafana workflow components and expands Grafana API interactions, plus renames
QueryDataSourceconfig (dataSourceUid→dataSource) and removes thetimezonefield, which could break existing saved workflows or affect time-range interpretation.Overview
Expands the Grafana integration with new workflow actions:
grafana.listDataSources,grafana.getDataSource,grafana.queryLogs(LogQL/Loki), andgrafana.queryTraces(TraceQL/Tempo), including example payloads and updated docs.Updates the backend client to fetch a single data source (
GetDataSource) and enriches theDataSourcemodel (id/type/url/default), wires the new components into the integration registry, and adds validation/tests (including Tempo-type enforcement for trace queries).Refactors
grafana.queryDataSourceconfiguration by renamingdataSourceUidtodataSourceand removing thetimezonefield; time parsing now treats offset-less datetime values as UTC and supports additional timestamp formats.Updates the workflow UI mappers to support the new components, align with the renamed
dataSourcefield, and add safer Grafana query-response parsing utilities to avoid crashes on sparse/unknown outputs.Reviewed by Cursor Bugbot for commit 2e6e67a. Bugbot is set up for automated code reviews on this repo. Configure here.