Interface TraceQueryClient
- All Known Implementing Classes:
InMemoryTraceQueryClient,SkyWalkingTraceQueryClient
public interface TraceQueryClient
Reads traces back from the service. A service package implements the lookups;
getDependencies(java.time.Instant, java.time.Instant) defaults to UnsupportedException; the …Async variants run the
synchronous method on the common pool unless overridden.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether this client's backend has native (non-hex) trace and span ids that the query model keeps verbatim (seeTraceIds).default List<DependencyLink> getDependencies(Instant start, Instant end) Service dependency graph in a time range.default CompletableFuture<List<DependencyLink>> getDependenciesAsync(Instant start, Instant end) AsynchronousgetDependencies(java.time.Instant, java.time.Instant).Fetches one trace.default CompletableFuture<Optional<Trace>> getTraceAsync(String traceId) AsynchronousgetTrace(java.lang.String); runs with the caller's id policy (acceptsNativeIds()).listOperations(String service) Lists operations (span names) of a service.default CompletableFuture<List<String>> listOperationsAsync(String service) AsynchronouslistOperations(java.lang.String).Lists services that reported spans.default CompletableFuture<List<String>> AsynchronouslistServices().searchTraces(TraceSearchQuery query) Searches traces.default CompletableFuture<List<TraceSummary>> AsynchronoussearchTraces(codes.grow.packages.skywalking.tracing.query.TraceSearchQuery); runs with the caller's id policy (acceptsNativeIds()).default TracewaitForTrace(String traceId) waitForTrace(String, WaitForTraceOptions)with defaults.default TracewaitForTrace(String traceId, WaitForTraceOptions options) PollsgetTrace(java.lang.String)until the trace has at leastminSpansspans.default CompletableFuture<Trace> waitForTraceAsync(String traceId, WaitForTraceOptions options) AsynchronouswaitForTrace(String, WaitForTraceOptions); runs with the caller's id policy (acceptsNativeIds()).
-
Method Details
-
getTrace
Fetches one trace.- Parameters:
traceId- trace id (normalised withTraceIds.traceId(java.lang.String))- Returns:
- the trace, or empty when the service does not know it (yet)
-
searchTraces
Searches traces.- Parameters:
query- filter- Returns:
- summaries
-
listServices
Lists services that reported spans.- Returns:
- service names
-
listOperations
Lists operations (span names) of a service.- Parameters:
service- service name- Returns:
- operation names
-
getDependencies
Service dependency graph in a time range.- Parameters:
start- range start ornullend- range end ornull- Returns:
- links
- Throws:
UnsupportedException- when the service has no dependency API
-
acceptsNativeIds
default boolean acceptsNativeIds()Whether this client's backend has native (non-hex) trace and span ids that the query model keeps verbatim (seeTraceIds). The default is the current thread's policy (TraceIds.nativeIdsAccepted()); a service whose ids are native overrides it to returntrueand wraps its own parsing inTraceIds.withNativeIds(acceptsNativeIds(), ...). The defaultwaitForTrace(String, WaitForTraceOptions)and the…Asynclookups run with this policy.- Returns:
- true when native ids are accepted by this client
-
waitForTrace
PollsgetTrace(java.lang.String)until the trace has at leastminSpansspans. The id is normalised and the polls run with this client's id policy (acceptsNativeIds()).- Parameters:
traceId- trace idoptions- timeout (30 s), interval (1 s), minSpans (1)- Returns:
- the trace
- Throws:
TimeoutException- when the trace is not complete in time
-
waitForTrace
waitForTrace(String, WaitForTraceOptions)with defaults.- Parameters:
traceId- trace id- Returns:
- the trace
-
getTraceAsync
AsynchronousgetTrace(java.lang.String); runs with the caller's id policy (acceptsNativeIds()).- Parameters:
traceId- trace id- Returns:
- future trace
-
searchTracesAsync
AsynchronoussearchTraces(codes.grow.packages.skywalking.tracing.query.TraceSearchQuery); runs with the caller's id policy (acceptsNativeIds()).- Parameters:
query- filter- Returns:
- future summaries
-
listServicesAsync
AsynchronouslistServices().- Returns:
- future names
-
listOperationsAsync
AsynchronouslistOperations(java.lang.String).- Parameters:
service- service name- Returns:
- future names
-
getDependenciesAsync
AsynchronousgetDependencies(java.time.Instant, java.time.Instant).- Parameters:
start- range start ornullend- range end ornull- Returns:
- future links
-
waitForTraceAsync
AsynchronouswaitForTrace(String, WaitForTraceOptions); runs with the caller's id policy (acceptsNativeIds()).- Parameters:
traceId- trace idoptions- options- Returns:
- future trace
-