Skip to content
25 changes: 1 addition & 24 deletions processor/tailsamplingprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ type tailSamplingSpanProcessor struct {
logger *zap.Logger

nextConsumer consumer.Traces
maxNumTraces uint64
policies []*policy
idToTrace sync.Map
policyTicker timeutils.TTicker
policyTicker *timeutils.PolicyTicker
tickerFrequency time.Duration
decisionBatcher idbatcher.Batcher
sampledIDCache cache.Cache[bool]
Expand Down Expand Up @@ -132,7 +131,6 @@ func newTracesProcessor(ctx context.Context, set processor.Settings, nextConsume
set: set,
telemetry: telemetry,
nextConsumer: nextConsumer,
maxNumTraces: cfg.NumTraces,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this really a noop?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the processor refers to cfg.NumTraces everywhere else

sampledIDCache: sampledDecisions,
nonSampledIDCache: nonSampledDecisions,
logger: telemetrySettings.Logger,
Expand Down Expand Up @@ -175,27 +173,6 @@ func newTracesProcessor(ctx context.Context, set processor.Settings, nextConsume
return tsp, nil
}

// withDecisionBatcher sets the batcher used to batch trace IDs for policy evaluation.
func withDecisionBatcher(batcher idbatcher.Batcher) Option {
return func(tsp *tailSamplingSpanProcessor) {
tsp.decisionBatcher = batcher
}
}

// withPolicies sets the sampling policies to be used by the processor.
func withPolicies(policies []*policy) Option {
return func(tsp *tailSamplingSpanProcessor) {
tsp.policies = policies
}
}

// withTickerFrequency sets the frequency at which the processor will evaluate the sampling policies.
func withTickerFrequency(frequency time.Duration) Option {
return func(tsp *tailSamplingSpanProcessor) {
tsp.tickerFrequency = frequency
}
}

// WithSampledDecisionCache sets the cache which the processor uses to store recently sampled trace IDs.
func WithSampledDecisionCache(c cache.Cache[bool]) Option {
return func(tsp *tailSamplingSpanProcessor) {
Expand Down
Loading
Loading