Repository navigation
feat: Document PromQL tiles and reject PromQL sources when PromQL is disabled in the external API - #3416
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 72f7e7c 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 |
346f8f8 to
0a19268
Compare
E2E Test Results✅ All tests passed • 458 passed • 1 skipped • 1874s
Tests ran across 4 shards in parallel. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
[Medium impact] The PR appears safe to merge, with two non-blocking documentation corrections still open.
|
ee3f2c4 to
01cfa97
Compare
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
PR Review
1 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 0 minor 1 posted as inline comment(s) on the changed lines. Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a documentation-only change: OpenAPI JSDoc annotations in two router files plus the regenerated Accuracy spot-checks (all pass):
🟡 P2 -- recommendedNone. 🔵 P3 nitpicks (1)
Reviewers (6): correctness, api-contract, previous-comments, project-standards, testing, maintainability. Testing gaps: None for this change — the documented request/response shapes are already exercised by 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 |
| * oneOf: | ||
| * - $ref: '#/components/schemas/HeatmapDistributionChartConfig' | ||
| * - $ref: '#/components/schemas/HeatmapSeriesChartConfig' | ||
| * - $ref: '#/components/schemas/HeatmapPromqlChartConfig' |
There was a problem hiding this comment.
should HeatmapChartConfig get a discriminator with a promql mapping, like the other tile groups?
Without one, generated clients have to work out the variant from the fields that are present.
discriminator:
propertyName: configType
mapping:
promql: '#/components/schemas/HeatmapPromqlChartConfig'1bc778a to
3a30795
Compare
3a30795 to
037ee88
Compare
pulpdrew
left a comment
There was a problem hiding this comment.
LGTM, but if we don't already can/should we:
- Note in the API that PromQL is a private preview feature and must be enabled before creating promql sources and tiles
- Reject requests that create promql sources if the toggle is not enabled?
8331ba1 to
5882c49
Compare
Add PromQL variants for each tile display type to the OpenAPI schemas, and correct the PromqlSource description: a PromQL source can read a ClickHouse TimeSeries table, not only a Prometheus endpoint.
Only line and stacked tiles query every expression; other display types query the first. Tables have one row per sample, and reducers also apply to instant queries.
5882c49 to
774b13b
Compare
Both good callouts! Especially the second one which I completely missed. Just updated now with one commit for each |
| * Shared fields for PromQL chart configs. Set configType to "promql" and | ||
| * provide sourceId + expressions. The connection is read from the source. | ||
| * PromQL is a preview feature and must be enabled on the deployment | ||
| * (ENABLE_PROMQL) before PromQL tiles can be queried. |
There was a problem hiding this comment.
FYI before merging to EE, ENABLE_PROMQL is misleading for CHC teams - we have a team level sysadmin flag for them, and they don't need to know what it's called. I would just say the feature needs to be enabled.
Deep Review✅ No critical issues found. This is a near-documentation PR: ~400 lines of OpenAPI JSDoc for PromQL dashboard tiles plus the regenerated 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (7): correctness, testing, maintainability, project-standards, api-contract, kieran-typescript, previous-comments. Testing gaps: Enabled-path coverage of the new gate is only implicit — the pre-existing 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 |
Summary
Document PromQL dashboard tiles in the external API OpenAPI spec, and reject creating PromQL sources while PromQL is disabled.
configType: "promql"variants for line, stacked_bar, stacked_line, table, number, pie, bar, and heatmap tiles, with shared schemas for expressions and common fields, matching what/api/v2/dashboardsaccepts and returns since feat: Support PromQL dashboard tiles in the external API #3379.PromqlSourcedescription, which said the connection must be a Prometheus endpoint and thatfromis unused. A PromQL source can also read a ClickHouse TimeSeries table, wherefromnames the table.packages/api/openapi.json.How to test
yarn workspace @hyperdx/api lint:openapi: no errors./api/v2/docson the running API and check that each dashboard tile display type lists a PromQL variant, and that thePromqlSourceschema describes both connection types.References