Package zipkin2.storage
Class QueryRequest
- java.lang.Object
-
- zipkin2.storage.QueryRequest
-
public final class QueryRequest extends java.lang.ObjectInvoking this request retrieves traces matching the below filters.Results should be filtered against
endTs, subject tolimitandlookback. For example, if endTs is 10:20 today, limit is 10, and lookback is 7 days, traces returned should be those nearest to 10:20 today, not 10:20 a week ago.Time units of
endTsandlookbackare milliseconds as opposed to microseconds, the grain ofSpan.timestamp(). Milliseconds is a more familiar and supported granularity for query, index and windowing functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>annotationQuery()When an input value is the empty string, include traces whoseSpan.annotations()include a value in this set, or whereSpan.tags()include a key is in this set.java.lang.StringannotationQueryString()Corresponds to query parameter "annotationQuery".longendTs()Only return traces where allSpan.timestamp()are at or before this time in epoch milliseconds.intlimit()Maximum number of traces to return.longlookback()Only return traces where allSpan.timestamp()are at or after (endTs - lookback) in milliseconds.java.lang.LongmaxDuration()Only return traces whoseSpan.duration()is less than or equal to maxDuration microseconds.java.lang.LongminDuration()Only return traces whoseSpan.duration()is greater than or equal to minDuration microseconds.static QueryRequest.BuildernewBuilder()java.lang.StringremoteServiceName()When present, only include traces with thisremote service name.java.lang.StringserviceName()When present, corresponds to thelocal service nameand constrains all other parameters.java.lang.StringspanName()When present, only include traces with thisSpan.name()booleantest(java.util.List<Span> spans)Tests the supplied trace against the current request.QueryRequest.BuildertoBuilder()java.lang.StringtoString()
-
-
-
Method Detail
-
serviceName
@Nullable public java.lang.String serviceName()
When present, corresponds to thelocal service nameand constrains all other parameters.- See Also:
ServiceAndSpanNames.getServiceNames()
-
remoteServiceName
@Nullable public java.lang.String remoteServiceName()
When present, only include traces with thisremote service name.
-
spanName
@Nullable public java.lang.String spanName()
When present, only include traces with thisSpan.name()- See Also:
ServiceAndSpanNames.getSpanNames(String)
-
annotationQuery
public java.util.Map<java.lang.String,java.lang.String> annotationQuery()
When an input value is the empty string, include traces whoseSpan.annotations()include a value in this set, or whereSpan.tags()include a key is in this set. When not, include traces whoseSpan.tags()an entry in this map.Multiple entries are combined with AND, and AND against other conditions.
-
minDuration
@Nullable public java.lang.Long minDuration()
Only return traces whoseSpan.duration()is greater than or equal to minDuration microseconds.
-
maxDuration
@Nullable public java.lang.Long maxDuration()
Only return traces whoseSpan.duration()is less than or equal to maxDuration microseconds. Only valid withminDuration.
-
endTs
public long endTs()
Only return traces where allSpan.timestamp()are at or before this time in epoch milliseconds. Defaults to current time.
-
lookback
public long lookback()
Only return traces where allSpan.timestamp()are at or after (endTs - lookback) in milliseconds. Defaults to endTs.
-
limit
public int limit()
Maximum number of traces to return. Defaults to 10
-
annotationQueryString
@Nullable public java.lang.String annotationQueryString()
Corresponds to query parameter "annotationQuery". Ex. "http.method=GET and error"
-
toBuilder
public QueryRequest.Builder toBuilder()
-
newBuilder
public static QueryRequest.Builder newBuilder()
-
test
public boolean test(java.util.List<Span> spans)
Tests the supplied trace against the current request.This is used when the backend cannot fully refine a trace query.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-