Class OpenTelemetrySpan
java.lang.Object
org.axonframework.tracing.opentelemetry.OpenTelemetrySpan
- All Implemented Interfaces:
org.axonframework.tracing.Span
Span implementation that uses OpenTelemetry's Span to provide tracing
capabilities to an application.
These traces should always be created using the OpenTelemetrySpanFactory since this will make sure the proper
parent context is extracted before creating the Span.
- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionOpenTelemetrySpan(io.opentelemetry.api.trace.SpanBuilder spanBuilder) Creates the span, based on theSpanBuilderprovided. -
Method Summary
Modifier and TypeMethodDescriptionorg.axonframework.tracing.SpanaddAttribute(String key, String value) voidend()org.axonframework.tracing.SpanScopeorg.axonframework.tracing.Spanorg.axonframework.tracing.Spanstart()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.tracing.Span
run, runCallable, runConsumer, runSupplier, wrapCallable, wrapConsumer, wrapRunnable, wrapSupplier
-
Constructor Details
-
OpenTelemetrySpan
public OpenTelemetrySpan(io.opentelemetry.api.trace.SpanBuilder spanBuilder) Creates the span, based on theSpanBuilderprovided. ThisSpanBuilderwill supply theSpanwhen thestart()method is invoked.- Parameters:
spanBuilder- The provider of theSpan.
-
-
Method Details
-
start
public org.axonframework.tracing.Span start()- Specified by:
startin interfaceorg.axonframework.tracing.Span
-
makeCurrent
public org.axonframework.tracing.SpanScope makeCurrent()- Specified by:
makeCurrentin interfaceorg.axonframework.tracing.Span
-
end
public void end()- Specified by:
endin interfaceorg.axonframework.tracing.Span
-
recordException
- Specified by:
recordExceptionin interfaceorg.axonframework.tracing.Span
-
addAttribute
- Specified by:
addAttributein interfaceorg.axonframework.tracing.Span
-