Skip to content

Commit

Permalink
chore: add missing funcSampler
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Nov 14, 2024
1 parent 771ca9b commit 8759a7b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ func CascadingSamplerFunc(shouldSample func(parameters trace.SamplingParameters)
description: description,
}
}

type funcSampler struct {
next trace.Sampler
fn func(trace.SamplingParameters) trace.SamplingResult
description string
}

func (f funcSampler) ShouldSample(parameters trace.SamplingParameters) trace.SamplingResult {
return f.fn(parameters)
}

func (f funcSampler) Description() string {
return f.description
}

0 comments on commit 8759a7b

Please sign in to comment.