mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Add properties to select OpenTelemetry's sampler
Closes gh-49548
This commit is contained in:
+33
@@ -150,6 +150,39 @@ Use the `management.tracing.export.zipkin.*` configuration properties to configu
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.sampling]]
|
||||
== Sampling
|
||||
|
||||
By default, Spring Boot samples only 10% of requests to prevent overwhelming the trace backend.
|
||||
The configprop:management.tracing.sampling.probability[] property can be used to configure this.
|
||||
|
||||
When using OpenTelemetry, you can also configure which sampler is used via the configprop:management.opentelemetry.tracing.sampler[] property.
|
||||
The following samplers are supported:
|
||||
|
||||
|===
|
||||
|Sampler |Description
|
||||
|
||||
|`always-on`
|
||||
|Samples every trace.
|
||||
|
||||
|`always-off`
|
||||
|Discards every trace.
|
||||
|
||||
|`trace-id-ratio`
|
||||
|Samples a fraction of traces based on configprop:management.tracing.sampling.probability[].
|
||||
|
||||
|`parent-based-always-on`
|
||||
|If the parent span is sampled, samples the child span. If there is no parent, samples every trace.
|
||||
|
||||
|`parent-based-always-off`
|
||||
|If the parent span is sampled, samples the child span. If there is no parent, discards every trace.
|
||||
|
||||
|`parent-based-trace-id-ratio` (default)
|
||||
|If the parent span is sampled, samples the child span. If there is no parent, samples a fraction of traces based on configprop:management.tracing.sampling.probability[].
|
||||
|===
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.micrometer-observation]]
|
||||
== Integration with Micrometer Observation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user