public class InMemoryTransactionStore extends Object implements TransactionStore
TransactionStore. This implementation uses
in-memory Map to
store transactions and related processor spans. Transactions are kept in
memory until they end.SPAN_ID, TRACE_CONTEXT_MAP_KEY, TRACE_ID, TRACE_PREV_CONTEXT_MAP_KEY, TRACE_TRANSACTION_ID| Constructor and Description |
|---|
InMemoryTransactionStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessorSpan(String containerName,
TraceComponent traceComponent,
io.opentelemetry.api.trace.SpanBuilder spanBuilder)
Add a new processor span under an existing transaction.
|
void |
addTransactionTags(String transactionId,
String tagPrefix,
Map<String,String> tags)
Add custom tags to an existing transaction.
|
SpanMeta |
endProcessorSpan(String transactionId,
String location,
Consumer<ProcessorSpan> spanUpdater,
Instant endTime)
This overloading allows to end a span at given time.
|
TransactionMeta |
endTransaction(String transactionId,
String flowName,
Consumer<io.opentelemetry.api.trace.Span> spanUpdater,
Instant endTime)
End a transaction at given end time.
|
static TransactionStore |
getInstance() |
String |
getTraceIdForTransaction(String transactionId)
Get the Trace Id associated the transaction
|
TransactionContext |
getTransactionContext(String transactionId,
org.mule.runtime.api.component.location.ComponentLocation componentLocation)
Get the
Context of the initiating flow span. |
void |
startTransaction(TraceComponent traceComponent,
String rootFlowName,
io.opentelemetry.api.trace.SpanBuilder rootFlowSpanBuilder)
Start a new transaction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendProcessorSpan, endProcessorSpan, endTransaction, endTransaction, transactionIdForpublic static TransactionStore getInstance()
public void startTransaction(TraceComponent traceComponent, String rootFlowName, io.opentelemetry.api.trace.SpanBuilder rootFlowSpanBuilder)
TransactionStorestartTransaction in interface TransactionStoretraceComponent - TraceComponent with tracing informationrootFlowName - Name of the flow requesting to start transaction.rootFlowSpanBuilder - SpanBuilder for building the root span.public void addTransactionTags(String transactionId, String tagPrefix, Map<String,String> tags)
TransactionStoreaddTransactionTags in interface TransactionStoretransactionId - A unique transaction id within the context of an application. Eg.
Correlation id.tags - Map of String Keys and String Values
containing the tags.public TransactionContext getTransactionContext(String transactionId, org.mule.runtime.api.component.location.ComponentLocation componentLocation)
TransactionStoreContext of the initiating flow span. This may be required to
propagate
context for a given transaction.getTransactionContext in interface TransactionStoretransactionId - A unique transaction id within the context of an application. Eg.
Correlation id.componentLocation - ComponentLocationContextpublic String getTraceIdForTransaction(String transactionId)
TransactionStoregetTraceIdForTransaction in interface TransactionStoretransactionId - A unique transaction id within the context of an application. Eg.
Correlation id.public TransactionMeta endTransaction(String transactionId, String flowName, Consumer<io.opentelemetry.api.trace.Span> spanUpdater, Instant endTime)
TransactionStoreTransactionStore.endTransaction(String, String, Consumer)endTransaction in interface TransactionStorepublic void addProcessorSpan(String containerName, TraceComponent traceComponent, io.opentelemetry.api.trace.SpanBuilder spanBuilder)
TransactionStoreaddProcessorSpan in interface TransactionStorecontainerName - String such as Flow name that contains requested locationspanBuilder - SpanBuilderpublic SpanMeta endProcessorSpan(String transactionId, String location, Consumer<ProcessorSpan> spanUpdater, Instant endTime)
TransactionStoreTransactionStore.endProcessorSpan(String,
String, Consumer).endProcessorSpan in interface TransactionStoreCopyright © 2024 AVIO Consulting. All rights reserved.