Package 

Interface InternalTracingApi


  • 
    public interface InternalTracingApi
    
                        

    Internal interface for hosted SDKs and access the tracing API

    • 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.

      • 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.