Should RateLimitingSampler be public?
See original GitHub issueI am trying to replicate* changes from SamplerAutoConfiguration
autoconfiguration logic into spring-cloud-gcp, but RateLimitingSampler
is package-private. Was it meant to be only package private, or is it okay to relax its visibility to public
? ProbabilityBasedSampler
, which is in the same package and is used similarly, is public already.
* I’d rather not replicate them at all and just rely on SamplerAutoConfiguration
, but whenever TraceAutoConfiguration
and SamplerAutoConfiguration
are both present, TraceAutoConfiguration
’s NEVER_SAMPLE sampler gets instantiated due to Spring Boot ordering (TraceAutoConfiguration
has an order and SamplerAutoConfiguration
does not, so SamplerAutoConfiguration
is processed at the end). From the docs, NEVER_SAMPLE seems like intended behavior.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
No added benefit whatsoever!
@AutoConfigureBefore(TraceAutoConfiguration.class)
inSamplerAutoConfiguration
will be the perfect solution to our problem; then I can remove the custom sampler beans from StackdriverTraceAutoConfiguration for good.There’s no such property to disable a sampler. It doesn’t make much sense to have one.