Interface CurrentTraceContextCustomizer
public interface CurrentTraceContextCustomizer
CurrentTraceContext
.
For example, a customizer can add a scope decorator
without affecting the the implementation (like thread locals).
This also allows one object to customize both BaggagePropagation
, via BaggagePropagationCustomizer
, and integration like MDC (log) correlation, by implementing both
customizer interfaces.
Integration examples
In practice, a dependency injection tool applies a collection of these instances prior to
building the tracing instance
. For example, an
injected List<CurrentTraceContextCustomizer>
parameter to a provider of CurrentTraceContext
.
Here are some examples, in alphabetical order:
Note: This type is safe to implement as a lambda, or use as a method reference as it
is effectively a FunctionalInterface
. It isn't annotated as such because the project has
a minimum Java language level 6.
- Since:
- 5.7
- See Also:
BaggagePropagationCustomizer
,TracingCustomizer
-
Field Summary
Fields Modifier and Type Field Description static CurrentTraceContextCustomizer
NOOP
Use to avoid comparing against null references -
Method Summary
Modifier and Type Method Description void
customize(CurrentTraceContext.Builder builder)