fix(#804): OTLP endpoint path, CLI retry, and flush warning - #821
fix(#804): OTLP endpoint path, CLI retry, and flush warning#821fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
Three fixes for regressions introduced by the OTel SDK migration (fullsend-ai#4510): 1. Endpoint path handling: resolveEndpoint() now appends /v1/traces to the generic OTEL_EXPORTER_OTLP_ENDPOINT per the OTLP spec. The signal-specific OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is used verbatim. Previously both were passed through identically, causing path-prefixed collector endpoints to 404. 2. CLI retry config: the exporter now uses CLI-appropriate retry timing (500 ms initial, 2 s max, 4 s elapsed) instead of the SDK defaults (5 s initial, 30 s max, 60 s elapsed) which cannot complete within the 5 s flush budget. 3. Flush warning: tp.Shutdown errors are now surfaced to stderr instead of being silently discarded, so operators can distinguish failed exports from successful ones. Wire-level integration tests exercise endpoint path construction, retry delivery, header injection, and retryable-failure behavior against an in-process OTLP HTTP sink. Note: golangci-lint not available in sandbox. pre-commit failed due to network error (cannot fetch origin). go vet passed. All tests pass with -race. Closes #804
|
🤖 Finished Review · ✅ Success · Started 3:08 AM UTC · Completed 3:20 AM UTC |
ReviewFindingsLow
Previous runReviewFindingsLow
Labels: PR fixes a bug in OTLP telemetry export (endpoint path, retry, flush warning) per issue #804 |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 6:48 AM UTC · Completed 6:54 AM UTC |
- Document why resolveEndpoint diverges from the *FromEnv naming pattern (it performs URL parsing beyond env-var reading). - Add inline comment explaining why f.Close() errors are discarded (file already flushed by SimpleSpanProcessor). Addresses review feedback on #821
🔧 Fix agent — iteration 1 (human-triggered)Addressed 2 of 3 review findings with documentation comments. Finding 1 (naming-consistency): added godoc explaining the intentional *FromEnv naming divergence for resolveEndpoint. Finding 2 (error-handling-idiom): added inline comment on f.Close() explaining why the error is discarded. Finding 3 (missing-operational-detail): disagreed — docs file is not in PR scope, and reviewer flagged it as a follow-up suggestion. Fixed (2):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:59 AM UTC · Completed 7:13 AM UTC |
There was a problem hiding this comment.
Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:
internal/telemetry/telemetry.go(file-level): Line 87 · [low] naming-convention
Function renamed from 'endpointFromEnv' to 'resolveEndpoint'. The codebase has both FromEnv and resolve patterns for functions of similar complexity. The rename is defensible — the function now performs URL parsing and path construction beyond simple env-var reading, and the rationale is documented inline.
|
This pull request has been automatically marked as stale because it has not had any activity in the last month. It will be closed in 2 weeks if no further activity occurs. Remove the |
Summary
Fixes three related regressions in the OTLP export path introduced by the OTel SDK migration (fullsend-ai#4510), each verified with the issue's live reproductions against
3c57dda9:resolveEndpoint()now appends/v1/tracesto the genericOTEL_EXPORTER_OTLP_ENDPOINTper the OTLP spec; the signal-specificOTEL_EXPORTER_OTLP_TRACES_ENDPOINTis used verbatim. Previously both were passed identically toWithEndpointURL, which overrides the SDK's path-join, causing path-prefixed collector endpoints (e.g./otlp) to 404.tp.Shutdownerrors are surfaced to stderr (fullsend: OTLP flush incomplete: ...) instead of being silently discarded, so operators can distinguish failed exports from successful ones.Changes
internal/telemetry/telemetry.go: ReplacedendpointFromEnv()withresolveEndpoint()that differentiates generic vs signal-specific endpoint vars per OTLP spec. AddedcliRetryconfig with short intervals. Surfacedtp.Shutdownerrors to stderr.internal/telemetry/telemetry_test.go: UpdatedTestSetup_OTLPExporterSeamandTestSetup_TracesEndpointPreferredto verify endpoint argument values. AddedTestResolveEndpoint_*unit tests covering generic append, signal-specific verbatim, and empty cases.internal/telemetry/wire_test.go(new): Wire-level integration tests with an in-process OTLP HTTP protobuf sink covering endpoint path construction (generic with path prefix, bare host:port, signal-specific verbatim), retry-after-503 delivery, header injection, and retryable-failure completion within budget.Testing
-raceand 94.2% coveragego vetpassesgolangci-lintnot available in sandbox; CI will run itCloses #804
Post-script verification
agent/804-otel-endpoint-flush-tests)ba77dbdbbd17e9bb18c47bf6efa023c98b697158..HEAD)