public class OpenTelemetrySpanFactory extends Object implements org.axonframework.tracing.SpanFactory
Span implementations that are compatible with OpenTelemetry java agent instrumentation. OpenTelemetry
is a standard to collect logging, tracing and metrics from applications. This SpanFactory focuses on
supporting the tracing part of the standard.
To get started with OpenTelemetry, check out their documentation. Note
that, even after configuring the correct dependencies, you still need to run the application using the OpenTelemetry
java agent to export data. Without this, it will have the same effect as the
NoOpSpanFactory since the data is not sent anywhere.
When creating a trace, the context of the current trace is used as a parent, instead of the one active at the time of
starting the span (Default OpenTelemetry behavior). This is done using SpanBuilder.setParent(Context).
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenTelemetrySpanFactory.Builder
Builder class to instantiate a
OpenTelemetrySpanFactory. |
| Constructor and Description |
|---|
OpenTelemetrySpanFactory(OpenTelemetrySpanFactory.Builder builder)
Instantiate a
OpenTelemetrySpanFactory based on the fields contained in the OpenTelemetrySpanFactory.Builder. |
| Modifier and Type | Method and Description |
|---|---|
static OpenTelemetrySpanFactory.Builder |
builder()
Instantiate a Builder to create a
OpenTelemetrySpanFactory. |
org.axonframework.tracing.Span |
createDispatchSpan(Supplier<String> operationNameSupplier,
org.axonframework.messaging.Message<?> parentMessage,
org.axonframework.messaging.Message<?>... linkedSiblings) |
org.axonframework.tracing.Span |
createHandlerSpan(Supplier<String> operationNameSupplier,
org.axonframework.messaging.Message<?> parentMessage,
boolean isChildTrace,
org.axonframework.messaging.Message<?>... linkedParents) |
org.axonframework.tracing.Span |
createInternalSpan(Supplier<String> operationNameSupplier) |
org.axonframework.tracing.Span |
createInternalSpan(Supplier<String> operationNameSupplier,
org.axonframework.messaging.Message<?> message) |
org.axonframework.tracing.Span |
createRootTrace(Supplier<String> operationNameSupplier) |
<M extends org.axonframework.messaging.Message<?>> |
propagateContext(M message) |
void |
registerSpanAttributeProvider(org.axonframework.tracing.SpanAttributesProvider provider) |
public OpenTelemetrySpanFactory(OpenTelemetrySpanFactory.Builder builder)
OpenTelemetrySpanFactory based on the fields contained in the OpenTelemetrySpanFactory.Builder.builder - the OpenTelemetrySpanFactory.Builder used to instantiate a OpenTelemetrySpanFactory instance.public static OpenTelemetrySpanFactory.Builder builder()
OpenTelemetrySpanFactory.
The SpanAttributeProvieders are defaulted to an empty list, and the Tracer
is defaulted to the tracer defined by GlobalOpenTelemetry.
OpenTelemetrySpanFactory.public <M extends org.axonframework.messaging.Message<?>> M propagateContext(M message)
propagateContext in interface org.axonframework.tracing.SpanFactorypublic org.axonframework.tracing.Span createRootTrace(Supplier<String> operationNameSupplier)
createRootTrace in interface org.axonframework.tracing.SpanFactorypublic org.axonframework.tracing.Span createHandlerSpan(Supplier<String> operationNameSupplier, org.axonframework.messaging.Message<?> parentMessage, boolean isChildTrace, org.axonframework.messaging.Message<?>... linkedParents)
createHandlerSpan in interface org.axonframework.tracing.SpanFactorypublic org.axonframework.tracing.Span createDispatchSpan(Supplier<String> operationNameSupplier, org.axonframework.messaging.Message<?> parentMessage, org.axonframework.messaging.Message<?>... linkedSiblings)
createDispatchSpan in interface org.axonframework.tracing.SpanFactorypublic org.axonframework.tracing.Span createInternalSpan(Supplier<String> operationNameSupplier)
createInternalSpan in interface org.axonframework.tracing.SpanFactorypublic org.axonframework.tracing.Span createInternalSpan(Supplier<String> operationNameSupplier, org.axonframework.messaging.Message<?> message)
createInternalSpan in interface org.axonframework.tracing.SpanFactorypublic void registerSpanAttributeProvider(org.axonframework.tracing.SpanAttributesProvider provider)
registerSpanAttributeProvider in interface org.axonframework.tracing.SpanFactoryCopyright © 2010–2023. All rights reserved.