feat: exclude health endpoints from tracing#48
Conversation
Add otelhttp.WithFilter to skip span creation for /healthz, /livez, and /readyz probe requests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1583 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe OpenTelemetry HTTP instrumentation wrapper in the query-service now applies a request filter to exclude the generated Livez and Readyz endpoints from tracing and metrics collection; other middleware and server behavior remain unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR reduces OpenTelemetry trace noise by preventing instrumentation from creating spans for Kubernetes probe endpoints on the query service HTTP server.
Changes:
- Adds an
otelhttp.WithFilterto the server’sotelhttp.NewHandlerwrapper. - Excludes requests to
/healthz,/livez, and/readyzfrom tracing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review comments from copilot-pull-request-reviewer[bot]: - cmd/http.go: use generated path helpers LivezQuerySvcPath() and ReadyzQuerySvcPath() instead of hard-coded strings; remove /healthz which has no mounted route in this service (per copilot-pull-request-reviewer[bot]) Resolves 1 review thread. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Issue: LFXV2-1583 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Review Feedback AddressedCommit: fd4c10b Changes Made
Threads Resolved1 of 1 unresolved threads addressed in this iteration. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| handler = otelhttp.NewHandler(handler, "query-service", | ||
| otelhttp.WithFilter(func(r *http.Request) bool { | ||
| p := r.URL.Path | ||
| return p != querysvcsvr.LivezQuerySvcPath() && p != querysvcsvr.ReadyzQuerySvcPath() |
Summary
otelhttp.WithFiltertootelhttp.NewHandlerto skip span creation for/healthz,/livez, and/readyzKubernetes probe endpointsTest plan
go build ./...passesIssue: LFXV2-1583
🤖 Generated with Claude Code