Repository navigation
feat: auto-detect a PromQL source during onboarding - #3310
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c51bc27 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review✅ No issues found. |
|
Deep ReviewAuto-detecting a PromQL source during onboarding. The core change is sound: TimeSeries detection and PromQL creation are both failure-isolated, the new 🟡 P2 — recommended
🔵 P3 nitpicks (7)
Reviewers (8): correctness, testing, maintainability, kieran-typescript, reliability, previous-comments, adversarial, api-contract. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 398 passed • 1 skipped • 1673s
Tests ran across 4 shards in parallel. |
414db2d to
1b8df8a
Compare
pulpdrew
left a comment
There was a problem hiding this comment.
LGTM and worked well locally.
Just confirming whether the following is/will be covered:
- "Connect to Demo Server" in IS_LOCAL_MODE will detect a time series table if one is present. Maybe this can be done as part of HDX-5450.
- Onboarding in ClickStack Cloud / ClickHouse observability (may be EE-specific modals?) will detect timeseries tables.
| @@ -480,6 +480,34 @@ export async function inferTableSourceConfig({ | |||
| }; | |||
| } | |||
|
|
|||
| // The TimeSeries table name used by the collector's PromQL schema migration | |||
| // and the dev ClickHouse remote-write handler. | |||
| const DEFAULT_TIME_SERIES_TABLE_NAME = 'metrics_ts'; | |||
There was a problem hiding this comment.
Do you know if this aligns with the table that is created in ClickHouse cloud when an org enables the timeseries engine? Ideally this should work well in Cloud for the Timeseries Private Preview.
There was a problem hiding this comment.
Good question. I don't believe a table is created. However, the docs suggest a name here, so I've added that as the preferred table.
Yep I think we should add this with the demo server changes.
Yeah, I planned to do this in the EE PR. |
2c73f22 to
c51bc27
Compare
Comments Outside DiffThese findings could not be posted inline.
|
Summary
When PromQL is enabled (
NEXT_PUBLIC_ENABLE_PROMQL=true), onboarding auto-detection now creates a PromQL source if the connection has a ClickHouse TimeSeries table, the same way it already creates Logs, Traces, Metrics and Sessions sources from the OTel tables.Metadata.getTimeSeriesTableslists tables withengine = 'TimeSeries'. Matching on the engine also skips the TimeSeries table's inner MergeTree tables.pickTimeSeriesTableprefersmetrics_ts(the table the collector's PromQL migration creates) in the OTel tables' database, then anymetrics_ts, then the only TimeSeries table if there is exactly one.How to test
Delete all sources then go to
/searchpage. OTEL and TSE sources are auto-detected and added.References