Repository navigation
Document the sw8 Sample value convention and the agent sampling policy - #14204
Merged
Merged
Conversation
SkyWalking builds complete metrics and topology from the reported traces, so agents commonly sample 100%, and storage is reduced by server-side trace sampling instead. The Sample value, designed at the beginning of the protocol, is therefore not used in practice: the agents always write 1 and don't use it to decide whether to trace. Describe this in the sw8 protocol doc, and state that an agent that receives a valid sw8 header should keep the upstream sampling decision instead of applying its own sampling rate. Rename the "Sample values:" label to "Example value:", which read as if it were about the Sample field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wankai123
approved these changes
Nov 7, 2026
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
Document how the SkyWalking agents use the
sw8Sample value, indocs/en/api/x-process-propagation-headers-v3.md.1and don't use the value to decide whether to trace. I checked Java, Go, Python, Node.js, Rust, nginx-lua, and client-js.sw8header should keep that decision instead of applying its own sampling rate. Ignore rules, a disconnected backend, and a full buffer still apply.This came up in #14201, where the Go agent re-sampled propagated traces. The Go agent fix is apache/skywalking-go#264, and its
agent.samplerdoc links to the new#samplinganchor here.Note: the Python agent's sampler (
SW_SAMPLE_N_PER_3_SECS, off by default) still runs before the incoming header is considered, so it doesn't follow the expected behavior yet.