docs: clarify bounded body-logging size semantics and ordered-stage rationale#86
Merged
Merged
Conversation
…ionale Two documentation gaps around HTTP instrumentation: Under BODY_AND_HEADERS logging, the response body capture is bounded to bodyPreviewMaxBytes, but the full body still flows to the consumer — a body larger than the cap is streamed in full while only a preview prefix is buffered. The logged response.body.size / response.body.preview fields therefore describe the captured preview, not necessarily the whole body, whereas response.content.length reports the body's true length. Document this in http-body-logging-and-concurrency.md and add a concise note to the HttpLogLevel.BODY_AND_HEADERS and HttpInstrumentationOptions KDoc so it is visible at the opt-in point, not just on LoggableResponseBody. Also explain why the stage-based http.pipeline layer uses an ordered Stage enum with single-step pillar stages (REDIRECT/RETRY/AUTH/LOGGING/SERDE) instead of nested HttpClient decorators: deterministic and inspectable run order, one place to reason about stage precedence, enforced pillar-uniqueness, and shared ordering across the sync and async runtimes — plus the one cost it buys, the PipelineNext.copy() re-drive contract that wrapping steps must honour. Added to pipelines.md with a cross-reference from architecture.md.
Clarify that the ordered-stage rationale lists five cross-cutting pillar stages (SERDE currently reserved/unused) and that SEND is also a singleton slot but represents the transport hop, not a configurable pillar — matching the six isPillar entries in the Stage enum.
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.
Summary
Fills two documentation gaps in the HTTP stack.
Bounded body-logging size semantics
Under
BODY_AND_HEADERS, the response body delivered to the consumer can be larger than the single-read logging preview. The preview is bounded bybodyPreviewMaxBytes(default 8 KiB) and the logged body-size field reflects the captured/preview size, while the full body still streams downstream to the consumer (its true length is available from the content-length field, and unknown-length streaming bodies are skipped for capture entirely). This was easy to misread as "logging truncates the body" or "the size field is the full size." Documented indocs/http-body-logging-and-concurrency.mdand in the relevantHttpInstrumentationOptions/HttpLogLevelKDoc.Why ordered stages instead of nested decorators
Documents the rationale for the
http.pipelinedesign — a flat, ordered list of stages (Stagewith fixed pillar ordering) rather than nested client decorators: deterministic and inspectable ordering, a single place to reason about stage precedence, enforced pillar-uniqueness, and shared sync/async ordering — along with the cost it carries (thenext.copy()re-drive contract). Added todocs/pipelines.mdwith a cross-reference fromdocs/architecture.md.Documentation only — no code or API change (KDoc additions on existing declarations).
Closes #18
Closes #77