Skip to content

feat: ClickHouse over fetch, and OpenTelemetry spans for every statement - #33

Merged
Makisuo merged 3 commits into
mainfrom
feat/clickhouse-http-semconv
Oct 15, 2026
Merged

Makisuo merged 3 commits into
mainfrom
feat/clickhouse-http-semconv

fix(clickhouse-http): kill the query when a body read or stream ends …

3cf5ef7
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 15, 2026 in 1m 32s

Confidence 9/10 · No issues found

🟢 Confidence 9/10 · safe to merge
Both the early-end kill guard and the peer attributes are pinned by tests the CI job actually ran; nothing new to fix.
quality 100/100 · no findings · tests covered · risk low · 1/1 new units observable

Closes the KILL QUERY guard over body reads and early-stopped streams, names the peer on the client's spans, and keeps a URL path for proxy prefixes. Safe to merge.

  • send returns its query_id; the JSON body read kills the query on interrupt
  • executeStream kills unless the body was read to the end (Stream.onEnd/ensuring)
  • Client spans carry server.address, server.port and peer.service, overridable via spanAttributes
  • A path in url is kept; the config doc no longer claims it is refused

Fixed since the last review

  • ✅ F1 · ClickHouse calls carry no peer.service, and their HTTP span is off
What was checked
  • peer.service, server.address, server.port land on the sql.execute span, and the caller's spanAttributes win (client.test.ts:247-280)
  • Stream ending early kills exactly once; a full read sends no kill (client.test.ts:206, 218, 229)
  • validateUrl still rejects credentials, a query string and a fragment, and keeps a path (client.test.ts:238, 282)
Observability coverage: 1 of 1 changes observable
Change Kind Observable Evidence
ClickHouse statement over HTTP (query, command, values, stream) database client call yes src/clickhouse-http/client.ts:278-285 sets db.system.name, db.namespace, server.address, server.port, peer.service on the client span

3cf5ef7 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.