Repository navigation
Limit OTLP HTTP response buffering to 64 KiB - #16751
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The test can permanently redirect OTel errors to an abandoned channel, potentially blocking batch processors and causing shutdown timeouts and goroutine leaks.
1 open issue
What changed in this PR
Bounds OTLP HTTP response buffering to 64 KiB across the gateway’s tracing exporters, addressing the stale configuration TODO from #16659.
Changes:
- Applies the response-size limit to every exporter, including fan-out endpoints.
- Adds boundary tests for error responses below, at, and above 64 KiB, checking diagnostic preservation and oversized-body errors.
| File | Description |
|---|---|
internal/tracing/provider.go |
Configures the 64 KiB response limit and removes the stale TODO. |
internal/tracing/provider_test.go |
Adds response-size boundary and error-diagnostic assertions. |
Review effort: Balanced (adaptive)
| oldHandler := otel.GetErrorHandler() | ||
| otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) { | ||
| exportErrors <- err | ||
| })) | ||
| t.Cleanup(func() { otel.SetErrorHandler(oldHandler) }) |
|
@copilot address review feedback and fix failing ci lint check |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed in 59647f9. The boundary test now asserts the SDK provider’s ForceFlush error without changing the global OTel error handler, and uses require.ErrorContains before inspecting errors. |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE (
|

The pinned OTel v1.47.0 exporter supports response-size limits, but exporter setup still had a stale TODO to enable one.
otlptracehttp.WithMaxResponseSize(64 * 1024)for every exporter, including fan-out endpoints, and remove the TODO.