-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Component(s)
processor/probabilisticsampler
Describe the issue you're reporting
In the probabilistic_sampler README, it mentions that the hash_seed
is selected by default:
opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor/README.md
Line 146 in 964a652
This mode is selected by default. |
However, later in the configuration sector, it says
the default is "proportional" unless either
hash_seed
is configured orattribute_source
is set torecord
.
opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor/README.md
Line 307 in 964a652
- `mode` (string, optional): One of "proportional", "equalizing", or "hash_seed"; the default is "proportional" unless either `hash_seed` is configured or `attribute_source` is set to `record`. |
According to the code below, the default mode is indeed hash_seed
. The const defaultMode
is also set to hash_seed
, which makes the following logic always select hash_seed
, regardless of whether the HashSeed
value is set or not:
opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor/sampler_mode.go
Lines 388 to 397 in 964a652
if mode == modeUnset { | |
// Reasons to choose the legacy behavior include: | |
// (a) having set the hash seed | |
// (b) logs signal w/o trace ID source | |
if cfg.HashSeed != 0 || (isLogs && cfg.AttributeSource != traceIDAttributeSource) { | |
mode = HashSeed | |
} else { | |
mode = defaultMode | |
} | |
} |
According to the #31894, it mentioned:
The default sampling mode remains HashSeed. We consider a future change of default to Proportional to be desirable.
I suppose we need a follow-up to decide if we want to switch the default sampling mode and correct the document accordingly to avoid any confusion. I'd love to open a PR for it, but I'm unsure how we want to proceed.