feat: add event patterns as a first-class dashboard tile type#2604
feat: add event patterns as a first-class dashboard tile type#2604brandon-pereira wants to merge 4 commits into
Conversation
Event patterns can now be created, edited, and saved as dashboard tiles with full parity across the UI, MCP, and External API v2. - Add EventPatterns to the DisplayType enum and all exhaustive switches (rawSqlParams, constants, external API conversions) - Dedicated Pattern Expression input in the tile edit UI with the sources default body expression as placeholder - Fix config persistence: select is now correctly saved as a string for EventPatterns (was falling through to the series array path) - Fix source switching: override from/connection/select from the live source so stale columns dont leak into queries - Add isStringSelectDisplayType guard to consolidate the repeated Search/EventPatterns display-type checks - Add MCP tile schema to both save and patch unions so agents can create pattern tiles - Add External API v2 Zod schema and bidirectional conversion so pattern tiles round-trip through GET/PUT without downgrade - Remove variant prop from PatternTable - parent containers own bg - Hide PatternColumnSelector in dashboard/preview contexts
🦋 Changeset detectedLatest commit: 3576cdc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
E2E Test Results❌ Error reading test results: ENOENT: no such file or directory, scandir 'all-test-results' |
Deep ReviewScope note: The base SHA passed to this review ( ✅ No critical issues found. The feature is cleanly implemented. Server-side pattern execution sanitizes the caller-supplied expression via the 🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers: The compound-engineering fan-out (correctness, adversarial, api-contract, kieran-typescript, julik-frontend-races, reliability, testing, maintainability, project-standards, agent-native) was dispatched against the corrected scope; at synthesis time only the learnings researcher had returned (no relevant prior learnings in Testing gaps:
|
- Replace naive comma heuristic with bracket-aware isSingleExpression() helper so expressions like COALESCE(a, b) are not silently discarded as multi-column strings - Normalize where field via stringValueOrDefault in external API EventPatterns conversion, matching the Search arm - Add changeset for the feature
pulpdrew
left a comment
There was a problem hiding this comment.
This is great, and should also enable showing more MCP requests as Notebook Tiles!
Just a few thoughts / comments
- Show warning when pattern expression is multi-column and will be overridden with the source default - Add EventPatternsChartConfig to OpenAPI JSDoc spec and regenerate openapi.json - Add event_patterns tile to POST and PUT round-trip integration tests - Use minHeight instead of fixed height for event patterns preview
Summary
Event patterns can now be created, edited, and saved as dashboard tiles — with full support across the UI, MCP server, and External API v2.
Previously, pattern mining was only available on the search page. Dashboard tiles had no way to persist a custom pattern expression, and the
PatternColumnSelectorused internal component state that was lost on reload. The MCP and External API schemas didn't includeevent_patternsat all, so agents and API consumers couldn't create or round-trip pattern tiles.What changed
Tile edit UI — EventPatterns gets its own editor section with a "Pattern Expression" input (labeled, with the source's default body expression as placeholder) and a WHERE filter. This replaces the generic SELECT input that Search uses, which was semantically wrong for patterns.
Config persistence fix —
convertFormStateToSavedChartConfigandconvertFormStateToChartConfignow correctly persistselectas a string for EventPatterns (it was falling through to theform.seriesarray path, discarding the user's input). A newisStringSelectDisplayTypeguard consolidates the repeatedSearch || EventPatternschecks across 4 call sites.Source-switching fix — The preview panel now overrides
from,connection,timestampValueExpression, andselectfrom the livetableSource(matching how the Search preview already works). This prevents stale columns from a previous source (e.g.SeverityTextfrom a log source) from leaking into a trace-table query. ThebodyValueExpressionfallback also rejects multi-column strings (containing commas) to guard against pre-fix saved tiles that storeddefaultTableSelectExpressionas the pattern expression.MCP — New
mcpEventPatternsTileSchemaadded to both the save and patch tile unions. Agents can create pattern tiles withdisplayType: "event_patterns",sourceId, optionalselect(pattern expression),where, andwhereLanguage.External API v2 — New Zod schema + bidirectional conversion. Pattern tiles now round-trip through GET/PUT without being silently downgraded to line charts.
PatternTable cleanup — Removed the
variantprop (parent containers own the background). ThePatternColumnSelectoris now only shown when external handlers are provided (search page); dashboard/preview tiles configure the expression in the edit UI instead.Screenshots