Repository navigation
Conversation
Integration: a Prometheus in docker-compose.ci.yml remote-reads default.metrics_ts from ClickHouse, so PromQL tiles, clickstack_promql and dashboard variables are checked to return the same results from a Prometheus endpoint, ClickHouse's Prometheus API and the table function, on one seeded dataset. A second suite covers the 10,000-row table cap, the limit param and the response budget with many series; line and reduced tiles still go over budget because seriesLabels is not trimmed, so those cases are it.failing until that is fixed. Image: smoke-all-in-one.sh gains --promql-mcp, which boots the auth all-in-one image with PromQL on, remote-writes one OTLP gauge and queries it over MCP. docker-build.yml runs it on the auth image.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
| # Streamable HTTP answers with one SSE event or a JSON body. | ||
| response="$(printf '%s\n' "$response" | sed -n 's/^data: //p' | grep . || printf '%s' "$response")" | ||
| text="$(jq -r '.result.content[0].text // .error.message' <<<"$response")" | ||
| [ "$(jq -r '.result.isError // false' <<<"$response")" = false ] || fail "$1: $text" |
There was a problem hiding this comment.
🔵 minor — mcp() doesn't treat JSON-RPC protocol errors as failures
For a JSON-RPC error response (unknown tool, invalid request, auth error from the transport), .result.isError // false evaluates to false. The check passes and mcp prints .error.message as if it were the tool result. The run only fails later, when the caller's jq '.result.data | length' can't parse that text. That failure has no ::error:: annotation and no container logs. Fix: also call fail when .error is present, e.g. jq -e '(.error == null) and ((.result.isError // false) == false)'.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| docker/clickhouse/** | ||
| docker/otel-collector/** | ||
| .vex/** | ||
| scripts/ci/smoke-all-in-one.sh |
There was a problem hiding this comment.
🔵 minor — The PromQL/MCP smoke never runs on PRs that change the MCP/PromQL code it tests
This step tests API behaviour (/api/mcp, clickstack_promql, PromQL tiles). The job's PR path filter deliberately leaves out packages/api/**, on the grounds that those changes "can't break the bundling layers". That reasoning holds for the old canary smoke but not for this one. A PR that breaks PromQL over MCP passes PR CI and only fails on the push to main. Fix: run this smoke in a job that triggers on packages/api/**, or document in the workflow that it only gates main.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
3 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 3 minor 2 posted as inline comment(s) on the changed lines. 1 listed below. Findings outside the changed lines1 minor
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 test- and CI-only change (new PromQL integration tests, a CI Prometheus service that remote-reads ClickHouse, a new worktree slot port, a fixture extension for per-series samples, and a 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, reliability, adversarial, previous-comments. 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 • 464 passed • 1 skipped • 1270s
Tests ran across 4 shards in parallel. |
Summary
PromQL in MCP runs on three backends (a Prometheus endpoint, ClickHouse's Prometheus HTTP API, and the ClickHouse table function), but the existing tests mock Prometheus. This adds tests that run real queries, so a backend that drifts or a broken image shows up in CI.
Integration tests (
packages/api)docker-compose.ci.ymlgets a pinned Prometheus that remote-readsdefault.metrics_tsfrom ClickHouse. All three backends then read the same seeded samples.promqlBackends.int.test.tssaves 14 PromQL tile types throughclickstack_save_dashboard. It checks that every backend returns the same results for each tile, forclickstack_promql(range and instant), and for a dashboard variable. It also asserts known values, and checks from the outgoing requests that each run really used the backend it's named for.promqlLargeResults.int.test.tsreturns 12,000 series and checks:limit=10000sent on table instant queries only;seriesLabelsisn't trimmed. Those cases areit.failing, so they flag themselves once it's fixed.seedTimeSeriesTagsTableaccepts per-seriessamples.HDX_CI_PROMETHEUS_PORT(19100 + slot).Image smoke (
scripts/ci/smoke-all-in-one.sh --promql-mcp)The new mode does this on the auth all-in-one image:
ENABLE_PROMQL=trueand anINGESTION_API_KEY.metrics_ts./api/mcpwithclickstack_promqland a saved PromQL tile (clickstack_query_tilesmust reportokwith data).docker-build.ymlnow loads the auth image and runs this step. The smoke script was added to the job's path filter, so this PR runs it.What I could and couldn't verify locally
it.failingincluded), and six neighbouring PromQL suites still pass (196 tests).ENABLE_PROMQLandINGESTION_API_KEYwiring. This PR's "Build All-in-One Image" job is the first real run.How to reproduce
Starting point: a local checkout with Docker.
On this branch:
make dev-int-build, thenmake dev-int FILE="promqlBackends promqlLargeResults". All 10 tests pass.docker buildx build -f docker/hyperdx/Dockerfile --target all-in-one-auth --load -t aio:local ...with the build contexts fromdocker-build.yml), then runscripts/ci/smoke-all-in-one.sh aio:local --promql-mcp.How to test on Vercel preview
N/A — non-UI change.
References
🤖 Generated with Claude Code