Skip to content

Limit OTLP HTTP response buffering to 64 KiB - #16751

Merged
lpcox merged 4 commits into
mainfrom
copilot/go-fan-go-module-review
Nov 18, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/go-fan-go-module-review

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

The pinned OTel v1.47.0 exporter supports response-size limits, but exporter setup still had a stale TODO to enable one.

  • Response bound: Add otlptracehttp.WithMaxResponseSize(64 * 1024) for every exporter, including fan-out endpoints, and remove the TODO.
  • Regression coverage: Check error responses below, at, and above 64 KiB. Oversized responses return a size-limit error without including body diagnostics; smaller responses retain them.

@lpcox lpcox changed the title [WIP] Review Go Module go.opentelemetry.io/otel Limit OTLP HTTP response buffering to 64 KiB Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 15:32
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 15:32
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread internal/tracing/provider_test.go Outdated
Comment on lines +93 to +97
oldHandler := otel.GetErrorHandler()
otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) {
exportErrors <- err
}))
t.Cleanup(func() { otel.SetErrorHandler(oldHandler) })
@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback and fix failing ci lint check

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback and fix failing ci lint check

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. make agent-finished passed, including golangci-lint, Go/integration tests, and all 724 Rust guard tests.

Comment thread internal/tracing/provider_test.go Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/README/commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 write tools absent from catalog (23 read-only tools only); none attempted BLOCKED ⚠️ INCONCLUSIVE
C CLI reads (github list_issues) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) not attempted — gh auth status: not logged in BLOCKED ⚠️ INCONCLUSIVE
E CLI GraphQL mutations (addReaction/addStar/createIssue) not attempted — gh unauthenticated BLOCKED ⚠️ INCONCLUSIVE

Overall: INCONCLUSIVE

(⚠️ = INCONCLUSIVE — Part B's 6 write targets (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) were absent from the 23-tool github MCP catalog, so gateway-level write enforcement could not be independently exercised via this surface. Parts D/E could not run because the gh CLI was unauthenticated in this environment, so the token-scope boundary was never tested. No write leaked in any probe that did run.)

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 02d6b12 into main Nov 18, 2026
28 checks passed
@lpcox
lpcox deleted the copilot/go-fan-go-module-review branch November 18, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[go-fan] Go Module Review: go.opentelemetry.io/otel

4 participants