Skip to content

[processor/probabilistic_sampler] The default sampling mode in documentation is self-contradictory #36802

@namco1992

Description

@namco1992

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:

However, later in the configuration sector, it says

the default is "proportional" unless either hash_seed is configured or attribute_source is set to record.

- `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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions