public class OpenTracerBallerinaWrapper extends Object
| Constructor and Description |
|---|
OpenTracerBallerinaWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTags(String spanId,
String tagKey,
String tagValue)
Method to add tags to an existing span.
|
Map<String,io.opentracing.SpanContext> |
extract(String encodedHeader)
Method to create an entry in span store by extracting a spanContext from a Map carrier.
|
void |
finishSpan(String spanId)
Method to mark a span as finished.
|
String |
getBaggageItem(String spanId,
String baggageKey)
Method to get a baggage value from an existing span.
|
static OpenTracerBallerinaWrapper |
getInstance() |
Map<String,String> |
inject(String suffix,
String spanId)
Method to inject the span context of a span into a map carrier.
|
void |
log(String spanId,
Map<String,String> logs)
Method to add logs to an existing span.
|
void |
setBaggageItem(String spanId,
String baggageKey,
String baggageValue)
Method to add baggage item to an existing span.
|
String |
startSpan(String serviceName,
String spanName,
Map<String,String> tags,
ReferenceType referenceType,
Map<String,io.opentracing.SpanContext> parentSpanContext)
Method to start a span using parent span context.
|
String |
startSpan(String serviceName,
String spanName,
Map<String,String> tags,
ReferenceType referenceType,
String parentSpanId)
Method to start a span using parent span id.
|
public static OpenTracerBallerinaWrapper getInstance()
public Map<String,io.opentracing.SpanContext> extract(String encodedHeader)
encodedHeader - map of headers used to extract a spanContextpublic Map<String,String> inject(String suffix, String spanId)
suffix - trace header suffix to distinguish between OOTB headers and user defined headers.spanId - the span Id of the span to be injectedpublic String startSpan(String serviceName, String spanName, Map<String,String> tags, ReferenceType referenceType, String parentSpanId)
serviceName - name of the service the span should belong tospanName - name of the spantags - key value paired tags to attach to the spanreferenceType - type of reference to any parent spanparentSpanId - id of the parent spanpublic String startSpan(String serviceName, String spanName, Map<String,String> tags, ReferenceType referenceType, Map<String,io.opentracing.SpanContext> parentSpanContext)
serviceName - name of the service the span should belong tospanName - name of the spantags - key value paired tags to attach to the spanreferenceType - type of reference to any parent spanparentSpanContext - map of the parent span contextpublic void finishSpan(String spanId)
spanId - the id of the span to finishpublic void addTags(String spanId, String tagKey, String tagValue)
spanId - the id of the spantagKey - the key of the tagtagValue - the value of the tagpublic void log(String spanId, Map<String,String> logs)
spanId - the id of the spanlogs - the map (event, message) to be loggedpublic void setBaggageItem(String spanId, String baggageKey, String baggageValue)
spanId - the id of the spanbaggageKey - the key of the baggage itembaggageValue - the value of the baggage itemCopyright © 2018 WSO2. All rights reserved.