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.TRACE_CONTEXT_MAP_KEY, TRACE_ID, TRACE_TRANSACTION_ID| Constructor and Description |
|---|
InMemoryTransactionStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessorSpan(String transactionId,
String location,
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.
|
void |
endProcessorSpan(String transactionId,
String location,
Consumer<io.opentelemetry.api.trace.Span> spanUpdater,
Instant endTime)
This overloading allows to end a span at given time.
|
void |
endTransaction(String transactionId,
String rootFlowName,
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
|
io.opentelemetry.context.Context |
getTransactionContext(String transactionId)
Get the
Context of the initiating flow span. |
void |
startTransaction(String transactionId,
String rootFlowName,
io.opentelemetry.api.trace.SpanBuilder rootFlowSpan)
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(String transactionId, String rootFlowName, io.opentelemetry.api.trace.SpanBuilder rootFlowSpan)
TransactionStorestartTransaction in interface TransactionStoretransactionId - A unique transaction id within the context of an application. Eg.
Correlation id.rootFlowName - Name of the flow requesting to start transaction.rootFlowSpan - 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 io.opentelemetry.context.Context getTransactionContext(String transactionId)
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.Contextpublic String getTraceIdForTransaction(String transactionId)
TransactionStoregetTraceIdForTransaction in interface TransactionStoretransactionId - A unique transaction id within the context of an application. Eg.
Correlation id.public void endTransaction(String transactionId, String rootFlowName, Consumer<io.opentelemetry.api.trace.Span> spanUpdater, Instant endTime)
TransactionStoreTransactionStore.endTransaction(String, String, Consumer)endTransaction in interface TransactionStorepublic void addProcessorSpan(String transactionId, String location, io.opentelemetry.api.trace.SpanBuilder spanBuilder)
TransactionStoreaddProcessorSpan in interface TransactionStorepublic void endProcessorSpan(String transactionId, String location, Consumer<io.opentelemetry.api.trace.Span> spanUpdater, Instant endTime)
TransactionStoreTransactionStore.endProcessorSpan(String,
String, Consumer).endProcessorSpan in interface TransactionStoreCopyright © 2022 AVIO Consulting. All rights reserved.