-
public interface InternalTracingApiInternal interface for hosted SDKs and access the tracing API
-
-
Method Summary
Modifier and Type Method Description abstract StringstartSpan(String name, String parentSpanId, Long startTimeMs)Create and start a new span. abstract BooleanstopSpan(String spanId, ErrorCode errorCode, Long endTimeMs)Stop an active span. abstract BooleanaddSpanEvent(String spanId, String name, Long timestampMs, Map<String, String> attributes)Create and add a Span Event with the given parameters to an active span with the given spanId. abstract BooleanaddSpanAttribute(String spanId, String key, String value)Add an attribute to an active span with the given spanId. abstract <T extends Any> TrecordSpan(String name, String parentSpanId, Map<String, String> attributes, List<Map<String, Object>> events, Function0<T> code)Record a span around the execution of the given lambda. abstract BooleanrecordCompletedSpan(String name, Long startTimeMs, Long endTimeMs, ErrorCode errorCode, String parentSpanId, Map<String, String> attributes, List<Map<String, Object>> events)Record a completed span with the given parameters. -
-
Method Detail
-
startSpan
abstract String startSpan(String name, String parentSpanId, Long startTimeMs)
Create and start a new span. Returns the spanId of the new span if both operations are successful, and null if either fails.
-
stopSpan
abstract Boolean stopSpan(String spanId, ErrorCode errorCode, Long endTimeMs)
Stop an active span. Returns true if the span is stopped after the method returns and false otherwise.
-
addSpanEvent
abstract Boolean addSpanEvent(String spanId, String name, Long timestampMs, Map<String, String> attributes)
Create and add a Span Event with the given parameters to an active span with the given spanId. Returns false if the event cannot be added.
-
addSpanAttribute
abstract Boolean addSpanAttribute(String spanId, String key, String value)
Add an attribute to an active span with the given spanId. Returns true if the attributed is added and false otherwise.
-
recordSpan
abstract <T extends Any> T recordSpan(String name, String parentSpanId, Map<String, String> attributes, List<Map<String, Object>> events, Function0<T> code)
Record a span around the execution of the given lambda. If an uncaught exception occurs during the execution, the span will be terminated as a failure.
The map representing an event has the following schema:
{ "name": String, "timestampMs": Long (optional), "timestampNanos": Long (deprecated and optional), "attributes": Map<String, String> (optional) }
Any object passed in the list that violates that schema will be dropped and no event will be created for it. If an entry in the attributes map isn't <String, String>, it'll also be dropped. Omitting or passing in nulls for the optional fields are OK.
-
recordCompletedSpan
abstract Boolean recordCompletedSpan(String name, Long startTimeMs, Long endTimeMs, ErrorCode errorCode, String parentSpanId, Map<String, String> attributes, List<Map<String, Object>> events)
Record a completed span with the given parameters. Returns true if the span is record and false otherwise.
-
-
-
-