0
votes

As per Spring Cloud Sleuth span Sampling we can control sampling rate.

Samplers do not stop span (correlation) ids from being generated, but they do prevent the tags and events being attached and exported. By default you get a strategy that continues to trace if a span is already active, but new ones are always marked as non-exportable.

To reduse performance bottlenack, Can we disable span ids generation in deployment instance at runtime without restarting application?

1
I am also having the same situation. Did you got any solution. What about writing a Custom Sampler? - Art

1 Answers

1
votes

In Edgware, the sampler bean is using @RefreshScope so you can, at runtime, change the sampling percentage. However, I don't know if that's exactly what you're asking for. Most likely you're asking about disabling Sleuth at all at runtime. That's unfortunately not possible by default. What you can do however is register a custom Random bean that can be @RefreshScoped and that will generate a fixed ID when required.