docs(traces,logs): bound the Retry-After window and record the OTLP status deviation - #61
Draft
turnipdabeets wants to merge 1 commit into
Draft
docs(traces,logs): bound the Retry-After window and record the OTLP status deviation#61turnipdabeets wants to merge 1 commit into
turnipdabeets wants to merge 1 commit into
Conversation
…tatus deviation Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BjT26chjUzuPSyJZqh4AWQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two gaps @jonmcwest raised against OTLP while reviewing posthog-js#4726. Both are in the shared retry policy, so both land in
logsandtracesin identical words.What the spec says today
Repeated refusals are undefined. The policy gives the wait for a refusal —
max(ownBackoff, min(parsedRetryAfter, documentedMaximum))— and says nothing about a second one arriving while the first window is still open. Read literally each refusal installs a fresh wait, so a host refused faster than the window is long slides the deadline forever.logsgates its size and reconnect triggers on the window being closed andmetricsre-arms its timer from it, so an unbounded slide suppresses all three for as long as that host keeps flushing — reachable in normal operation by a React Native app takingflush()on every app-state transition.The
5xxretry set diverges from OTLP without saying so. The policy requires408/429/5xxretriable; OTLP permits only429/502/503/504. The PostHog rule is deliberate, but nothing records that, so each reviewer rediscovers it as a possible defect — which is exactly what happened here.What changes
408/5xxset is recorded as a deliberate OTLP divergence, with its reason and the condition for revisiting it.Three scenarios per capability cover extend, don't-shrink, and the ceiling.
The trade-off, stated in the spec
Bounding the window serves a longer wait short, so the SDK may retry before a newer
Retry-Afterexpires — which OTLP does not sanction. Honouring every fresh header instead makes the suppression above unbounded, which costs records once the queue fills. One risks a request every few minutes against a rate-limited endpoint; the other risks data. The ceiling fails toward keeping records.This is currently dormant either way:
capture-logssends noRetry-Afterand no429(greppedrust/capture-logs/src/), so every header an SDK sees comes from a customer's proxy or CDN. posthog/posthog#75090 would have changed that and was closed unmerged. The spec names that as the revisit trigger.Impact
posthog-jsalready implements the ceiling as of #4726 — no follow-up code change there.5xxare transient, and would be its own proposal.openspec validate --specs --strict→ 62 passed, 0 failed.openspec validate clarify-otlp-retry-window-and-status-deviation --strict→ valid.🤖 Generated with Claude Code
https://claude.ai/code/session_01BjT26chjUzuPSyJZqh4AWQ