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 containerName)
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) |
io.opentelemetry.api.metrics.Meter |
get(String instrumentationScopeName) |
AppIdentifier |
getAppIdentifier() |
org.mule.runtime.core.api.el.ExpressionManager |
getExpressionManager() |
static OpenTelemetryConnection |
getInstance(OpenTelemetryConfigWrapper openTelemetryConfigWrapper) |
OpenTelemetryMetricsProviderCollection |
getMetricsProviders() |
Map<String,String> |
getTraceContext(String transactionId)
Get the trace context information for a given transaction id.
|
Map<String,String> |
getTraceContext(String transactionId,
String 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 |
isTurnOffMetrics() |
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) |
public static final String TRACE_ID_LONG_LOW_PART
public static final String SPAN_ID_LONG
public AppIdentifier getAppIdentifier()
public boolean isTurnOffTracing()
public boolean isTurnOffMetrics()
public OpenTelemetryMetricsProviderCollection getMetricsProviders()
public static void resetForTest()
public static OpenTelemetryConnection getInstance(OpenTelemetryConfigWrapper openTelemetryConfigWrapper)
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, String 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 io.opentelemetry.api.metrics.Meter get(String instrumentationScopeName)
public org.mule.runtime.core.api.el.ExpressionManager getExpressionManager()
public void addProcessorSpan(TraceComponent traceComponent, String containerName)
Span for given TraceComponent and adds it to the
TraceComponent.getTransactionId() transaction.traceComponent - TraceComponentcontainerName - 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.