Repository navigation
feat(observability): time HTTP requests and query-path ClickHouse calls - #866
Conversation
wavehouse_http_request_duration_seconds{route, method, status_class}
times every request but the SSE streams, by route pattern, on every
listener. wavehouse_clickhouse_query_duration_seconds{operation, result}
times each statement /v1/query, the pipes and /v1/ops/query send, with
result ok or the response's error code. First tier of #94.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YVNGPfArHqjc3Xt6N9App
…ailable Also correct where a tenant refusal's route label lands and that only server.port is timed, per pre-push review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YVNGPfArHqjc3Xt6N9App
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YVNGPfArHqjc3Xt6N9App
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YVNGPfArHqjc3Xt6N9App
…he unmatched sentence Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YVNGPfArHqjc3Xt6N9App
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
📚 Docs preview✅ Live: https://pr-866-wavehouse-docs.wave-rf.workers.dev (follows this PR)
Earlier commits (1)
|
Code coverage overviewLanguages: Go Go
View coverage of the 8 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
|
@coderabbitai review Generated by Claude Code |
✅ Action performedReview finished.
|
…uery-tier-fh85bw # Conflicts: # internal/api/router.go
Requested by Taite · project thread
Summary
The first tier of #94. Before this, the only request metrics came from otelhttp. Those carry no route, so a slow or failing endpoint could not be told apart from the rest. Nothing timed the statements the query paths send to ClickHouse.
wavehouse_http_request_duration_seconds{route, method, status_class}times every request onserver.portexcept SSE streams. The middleware lives innewProbeRouter, so both the API router and the ops-only router get it. It sits outsidejsonRecoverer, so a panic counts as a5xx.routeis the chi pattern (/v1/pipes/{name}), never the path. It is the mount's own pattern (/v1/*,/v1/ops/*) for a request a mount answers short of a route, andunmatchedfor one that reached no mount.methodis net/http's orother.wavehouse_clickhouse_query_duration_seconds{operation, result}times each statement sent byPOST /v1/query(query), a pipe (pipe,pipe_write) orPOST /v1/ops/query(ops_query).resultisok,canceled(the client went away), or the response's error code without itsclickhouse.prefix, through the samechFailureOfthe response uses. It is recorded inside the singleflight closure, so a cache hit records nothing and coalesced requests record once._countgives both the rate and the error rate, so there is no separate_errors_total. Neither metric carries a tenant or table label.This touches
router.go(one line), which #855 also edits. It should merge after #855.Test plan
internal/api/metrics_test.gocovers:/v1/*,/v1/ops/*,unmatched. Panic as 5xx,/v1/streamskipped.query,pipeandpipe_write.go test -race ./internal/api/ ./internal/app/and golangci-lint on./internal/api/...Related Issues
Part of #94, part of #777. The worker's
INSERTtiming, the next tier, waits on #770.Generated by Claude Code