Class QueryRequest


  • public final class QueryRequest
    extends java.lang.Object
    Invoking this request retrieves traces matching the below filters.

    Results should be filtered against endTs, subject to limit and lookback. 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 endTs and lookback are milliseconds as opposed to microseconds, the grain of Span.timestamp(). Milliseconds is a more familiar and supported granularity for query, index and windowing functions.

    • Method Detail

      • annotationQuery

        public java.util.Map<java.lang.String,​java.lang.String> annotationQuery()
        When an input value is the empty string, include traces whose Span.annotations() include a value in this set, or where Span.tags() include a key is in this set. When not, include traces whose Span.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 whose Span.duration() is greater than or equal to minDuration microseconds.
      • maxDuration

        @Nullable
        public java.lang.Long maxDuration()
        Only return traces whose Span.duration() is less than or equal to maxDuration microseconds. Only valid with minDuration.
      • endTs

        public long endTs()
        Only return traces where all Span.timestamp() are at or before this time in epoch milliseconds. Defaults to current time.
      • lookback

        public long lookback()
        Only return traces where all Span.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
      • 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:
        toString in class java.lang.Object