Skip to content

CompositeSampler allows later samplers to upgrade RecordOnly to RecordAndSample #8

@thumbrise

Description

@thumbrise

The ShouldSample loop at signal/trace/composite_sampler.go:36-41 only short-circuits on Drop. For non-Drop decisions, the last sampler's result wins. This means if sampler A returns RecordOnly and sampler B returns RecordAndSample, the final result is RecordAndSample — the earlier restriction is silently overridden. The existing tests don't cover this case (the "mixed decisions" test has a Drop in the middle which short-circuits before this interaction matters). If the intended semantics are AND-like (any sampler can restrict but not upgrade), this behavior is incorrect. If the intent is pipeline/last-wins semantics, it's fine but worth documenting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions