Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Build tracer with customized sampler object not just by sampling rate #84

Closed
buxingzhe opened this issue Jan 26, 2021 · 0 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@buxingzhe
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Currently, trace_opts.go provides a function to set sampler with signature func WithSampler(samplingRate float64) TracerOption . I hope it can provide another function like func WithSampler(sampler Sampler) TracerOption, then I can set my customized sampler.
At the same time, the RandomSampler has a little bug:

func (s *RandomSampler) IsSampled(operation string) bool {
	return s.threshold >= s.rand.Intn(100)
}

It should be s.threshold > s.rand.Intn(100).

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@arugal arugal added the enhancement New feature or request label Jan 31, 2021
@arugal arugal added this to the 0.1.0 milestone Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants