public class OpenTelemetryConnection extends Object implements TraceContextHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenTelemetryConnection.HashMapTextMapSetter |
| Modifier and Type | Field and Description |
|---|---|
Map<String,String> |
OTEL_SYSTEM_PROPERTIES_MAP
Collect all otel specific system properties and cache them in a map.
|
static String |
SPAN_ID_LONG |
static String |
TRACE_ID_LONG_LOW_PART |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessorSpan(TraceComponent traceComponent,
String rootContainerName)
Creates a
Span for given TraceComponent and adds it to the
TraceComponent.getTransactionId() transaction. |
SpanMeta |
endProcessorSpan(TraceComponent traceComponent,
org.mule.runtime.api.message.Error error) |
TransactionMeta |
endTransaction(TraceComponent traceComponent,
Exception exception) |
static OpenTelemetryConnection |
getInstance() |
static OpenTelemetryConnection |
getInstance(OpenTelemetryConfigWrapper openTelemetryConfigWrapper) |
Map<String,String> |
getTraceContext(String transactionId)
Get the trace context information for a given transaction id.
|
Map<String,String> |
getTraceContext(String transactionId,
org.mule.runtime.api.component.location.ComponentLocation componentLocation)
Get the trace context information for a given transaction id.
|
<T> io.opentelemetry.context.Context |
getTraceContext(T carrier,
io.opentelemetry.context.propagation.TextMapGetter<T> textMapGetter) |
TransactionStore |
getTransactionStore() |
<T> void |
injectTraceContext(T carrier,
io.opentelemetry.context.propagation.TextMapSetter<T> textMapSetter) |
void |
invalidate() |
boolean |
isTurnOffTracing() |
static void |
resetForTest()
This is for tests to reset the static instance in-between the tests.
|
void |
setSpanStatus(TraceComponent traceComponent,
io.opentelemetry.api.trace.Span span) |
io.opentelemetry.api.trace.SpanBuilder |
spanBuilder(String spanName) |
void |
startTransaction(TraceComponent traceComponent) |
static Supplier<OpenTelemetryConnection> |
supplier()
Supplier to use with
ConnectionProvider where lazy
initialization is required. |
public static final String TRACE_ID_LONG_LOW_PART
public static final String SPAN_ID_LONG
public boolean isTurnOffTracing()
public static Supplier<OpenTelemetryConnection> supplier()
Supplier to use with
ConnectionProvider where lazy
initialization is required.Supplier<OpenTelemetryConnection>public static void resetForTest()
public static OpenTelemetryConnection getInstance(OpenTelemetryConfigWrapper openTelemetryConfigWrapper)
public static OpenTelemetryConnection getInstance()
public io.opentelemetry.api.trace.SpanBuilder spanBuilder(String spanName)
public <T> io.opentelemetry.context.Context getTraceContext(T carrier,
io.opentelemetry.context.propagation.TextMapGetter<T> textMapGetter)
getTraceContext in interface TraceContextHandlerpublic Map<String,String> getTraceContext(String transactionId)
Map with
at least one entry with key TransactionStore.TRACE_TRANSACTION_ID and
transactionId as value.
The other entries in the map depends on the propagator used.
For W3C Trace Context Propagator, it can contain entries for `traceparent`
and optionally `tracestate`.transactionId - Local transaction idpublic Map<String,String> getTraceContext(String transactionId, org.mule.runtime.api.component.location.ComponentLocation componentLocation)
Map with
at least one entry with key TransactionStore.TRACE_TRANSACTION_ID and
transactionId as value.
The other entries in the map depends on the propagator used.
For W3C Trace Context Propagator, it can contain entries for `traceparent` and optionally `tracestate`.
transactionId - Local transaction idcomponentLocation - ComponentLocation to get context forpublic <T> void injectTraceContext(T carrier,
io.opentelemetry.context.propagation.TextMapSetter<T> textMapSetter)
injectTraceContext in interface TraceContextHandlerpublic TransactionStore getTransactionStore()
public void invalidate()
public void addProcessorSpan(TraceComponent traceComponent, String rootContainerName)
Span for given TraceComponent and adds it to the
TraceComponent.getTransactionId() transaction.traceComponent - TraceComponentrootContainerName - String name of the container such as flow that holds this
componentpublic SpanMeta endProcessorSpan(TraceComponent traceComponent, org.mule.runtime.api.message.Error error)
public void startTransaction(TraceComponent traceComponent)
public TransactionMeta endTransaction(TraceComponent traceComponent, Exception exception)
public void setSpanStatus(TraceComponent traceComponent, io.opentelemetry.api.trace.Span span)
Copyright © 2024 AVIO Consulting. All rights reserved.