Skip to content

Introduce request-level tracing sampler based on tenant tier #697

Description

@thlpkee20-wq

Description

Sample enterprise-tier traffic at 100 percent and free-tier at 1 percent, both driven by attributes at span start. Complements tail-based sampling with head-based control.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: internal/tracing/tracing.go
  • Use ParentBased(TraceIDRatioBased) with attribute overrides

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/tenant-aware-sampler
  • Implement changes
    • Add internal/tracing/sampler.go
    • Wire into provider setup
    • Metrics for sampled_total by tier
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • go test ./internal/tracing/...
  • Cover edge cases
    • Missing tier defaults to global ratio
  • Include test output and notes

Example commit message

feat: tenant-tier-aware trace sampler

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave issue batch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions