Skip to content

Snapshot profiling: SPLUNK_SNAPSHOT_SELECTION_PROBABILITY has no maximum enforcement #701

@pmcollins

Description

@pmcollins

Summary

The SPLUNK_SNAPSHOT_SELECTION_PROBABILITY env var accepts any float value with no upper bound validation, but the GDI spec sets a maximum selection rate of 0.10.

Spec requirement

GDI Specification v1.8.0 — behaviors.md (Trace Selection):

Trace selection MUST be randomized with the following constraints:

  • Default selection rate of 0.01
  • Maximum selection rate of 0.10

Note: there is an internal inconsistency in the spec — configuration.md says MUST be 0 < n <= 1, while behaviors.md says max 0.10. The behaviors section is more specific.

Current state

src/splunk_otel/propagator.py:75-77 and src/splunk_otel/distro.py:134 pass the value directly to TraceIdRatioBased with no clamping or warning. A user setting SPLUNK_SNAPSHOT_SELECTION_PROBABILITY=1.0 would get 100% selection with no error.

Expected

  • Clamp the value to (0.0, 0.10] or log a warning when the value exceeds 0.10
  • Raise or warn on values <= 0

References

  • src/splunk_otel/propagator.py:75-77
  • src/splunk_otel/distro.py:134

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions