Repository navigation
feat: Support series mode on builder heatmaps #3291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@hyperdx/app': minor | ||
| '@hyperdx/common-utils': minor | ||
| '@hyperdx/api': patch | ||
| --- | ||
|
|
||
| feat: Add a series mode to builder heatmaps |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import { getHeatmapMode } from '@hyperdx/common-utils/dist/core/heatmap'; | ||
| import { | ||
| displayTypeSupportsBuilderAlerts, | ||
| displayTypeSupportsRawSqlAlerts, | ||
|
|
@@ -538,6 +539,20 @@ function convertTileToExternalChart( | |
| return undefined; | ||
| } | ||
|
|
||
| // Series-mode heatmaps have no external schema yet. Emitting them as | ||
| // distribution tiles would corrupt them on a GET -> PUT round-trip. | ||
| if ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 major — External API/MCP GET now drops series-mode heatmap tiles, so a GET → PUT round-trip deletes them PUT replaces the tile list, and its TileInput doc in v2/dashboards.ts says only tiles whose id matches an existing tile are kept. So any client that reads a dashboard and writes it back silently deletes every series heatmap a user built in the UI. On update, merge back the existing tiles that GET skipped (series heatmaps, and PromQL by the same reasoning), or reject the PUT. The comment saying this avoids corruption is misleading, because the tile ends up deleted instead. Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond |
||
| isBuilderSavedChartConfig(tile.config) && | ||
| tile.config.displayType === DisplayType.Heatmap && | ||
| getHeatmapMode(tile.config) === 'series' | ||
| ) { | ||
| logger.warn( | ||
| { dashboardId, tileId: tile.id }, | ||
| 'Skipping series-mode heatmap tile in external API response (not yet supported)', | ||
| ); | ||
| return undefined; | ||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
| } | ||
|
|
||
| // Returned in case of a failure converting the saved chart config | ||
| const defaultTileConfig: ExternalDashboardTileConfig = | ||
| isRawSqlSavedChartConfig(tile.config) | ||
|
|
@@ -1051,7 +1066,7 @@ function getMissingSources( | |
| /** | ||
| * Returns source IDs referenced by heatmap tiles that exist but are not | ||
| * compatible with heatmap rendering. The heatmap UI gates the source picker | ||
| * via the same `HEATMAP_ALLOWED_SOURCE_KINDS` set used here (see | ||
| * via the same `HEATMAP_DISTRIBUTION_SOURCE_KINDS` set used here (see | ||
|
pulpdrew marked this conversation as resolved.
Resolved
|
||
| * `packages/common-utils/src/guards.ts` and `ChartEditorControls.tsx`), so | ||
| * UI and API gates move together. | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.