GIE-394: Render Perses charts for observability data#112
GIE-394: Render Perses charts for observability data#112
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eyevana The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@eyevana: This pull request references GIE-394 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@eyevana: This pull request references GIE-394 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@eyevana: This pull request references GIE-394 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
| return undefined; | ||
| } | ||
|
|
||
| const matchingCalls = toolCalls.filter((toolCall) => toolCall.name === inputDataType); |
There was a problem hiding this comment.
What would happen if multiple execute_range_query queries happened during the same call?
There was a problem hiding this comment.
It should pull the args from the last execute_range_query tool call in the list.
There was a problem hiding this comment.
is there a plan to improve this? It's not impossible for multiple relevant queries could be made as part of the same request. Not a blocker, but would be good to have a plan there.
|
@eyevana: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
This PR adds support for rendering Perses visualization charts (TimeSeriesChart and PieChart) directly in the chat interface. When the AI generates NGUI widget configurations with Perses components, the system now renders interactive Prometheus-backed charts instead of static content.
Type of Change
Related Issues
Fixes #
Changes Made
New Files
Perses Components (
src/components/perses/)PersesTimeSeries.tsx- Time series chart component for range queries (stacked area chart)PersesPieChart.tsx- Pie chart component for instant queriesPersesWidgetWrapper.tsx- Provider wrapper that sets up Perses context (theme, plugins, datasource, time range)componentRegistry.ts- Lazy-loaded component registry with type guards for Perses componentspluginsLoader.ts- Configures Perses plugin system with all required chart pluginsqueryClient.ts- React Query client configuration for PersesocpDatasourceApi.ts- Datasource API implementation for OpenShift Prometheus proxycachedDatasource.ts- Caching layer for datasource APITypes and Hooks
src/types/perses.ts- TypeScript type definitions for Perses props and component namessrc/hooks/useTimeRange.ts- Hook to convert start/end/duration into Perses TimeRangeValueModified Files
Widget Rendering
src/components/artifacts/WidgetRenderer.tsxisPersesComponent()type guard<Suspense>fallbackDynamicComponentfor non-Perses widgetssrc/components/artifacts/ArtifactRenderer.tsxtoolCallsprop toWidgetRendererfor query parameter extractionChat Integration
src/components/Chat/AIMessage.tsxtoolCallstoArtifactRendererConfiguration
backend/lightspeed-stack/ngui_openshift_mcp_config.yamlexecute_range_querymapping toPersesTimeSeriesexecute_instant_querymapping toPersesPieChartDependencies Added (
package.json)@perses-dev/*packages (components, core, dashboards, plugin-system, prometheus-plugin, chart plugins)@tanstack/react-query- For Perses data fetching@mui/material,@emotion/react,@emotion/styled- Required by Perses UIecharts- Charting library used by Persesdate-fns-tz,immer,lodash,lru-cache,use-resize-observerTesting Done
Test Details:
execute_range_querytool resultsexecute_instant_querytool resultsScreenshots/Videos
Click to expand
Definition of Done (DOD)
Code Quality
Testing
Documentation
Review & Quality
Pre-Merge
Additional Notes
This is not the final solution. When Libor returns from PTO, we'll get the arguments we need from the previous tool call in the NGUI generate_ui response. I won't need to pass tool calls down to the widgets like I've done here. See thread.
Reviewer Guidance