Class ITSpanStore

  • Direct Known Subclasses:
    ITInMemoryStorage.ITSpanStore

    public abstract class ITSpanStore
    extends java.lang.Object
    Base test for SpanStore.

    Subtypes should create a connection to a real backend, even if that backend is in-process.

    • Constructor Detail

      • ITSpanStore

        public ITSpanStore()
    • Method Detail

      • storage

        protected abstract zipkin2.storage.StorageComponent storage()
        Should maintain state between multiple calls within a test.
      • store

        protected zipkin2.storage.SpanStore store()
      • clear

        public abstract void clear()
                            throws java.lang.Exception
        Clears store between tests.
        Throws:
        java.lang.Exception
      • getTrace_considersBitsAbove64bit

        public void getTrace_considersBitsAbove64bit()
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getTrace_returnsEmptyOnNotFound

        public void getTrace_returnsEmptyOnNotFound()
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • allShouldWorkWhenEmpty

        public void allShouldWorkWhenEmpty()
                                    throws java.io.IOException
        This would only happen when the store layer is bootstrapping, or has been purged.
        Throws:
        java.io.IOException
      • allShouldWorkWhenNoIndexableDataYet

        public void allShouldWorkWhenNoIndexableDataYet()
                                                 throws java.io.IOException
        This is unlikely and means instrumentation sends empty spans by mistake.
        Throws:
        java.io.IOException
      • deduplicates

        public void deduplicates()
                          throws java.io.IOException
        Ideally, storage backends can deduplicate identical documents as this will prevent some analysis problems such as double-counting dependency links or other statistics. While this test exists, it is known not all backends will be able to cheaply make it pass. In other words, it is optional.
        Throws:
        java.io.IOException
      • getTraces_groupsTracesTogether

        public void getTraces_groupsTracesTogether()
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getTraces_considersBitsAbove64bit

        public void getTraces_considersBitsAbove64bit()
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • getTraces_filteringMatchesMostRecentTraces

        public void getTraces_filteringMatchesMostRecentTraces()
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_localServiceName

        public void getTraces_localServiceName()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_remoteServiceName

        public void getTraces_remoteServiceName()
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_remoteServiceName_withoutServiceName

        public void getTraces_remoteServiceName_withoutServiceName()
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_remoteServiceName_128

        public void getTraces_remoteServiceName_128()
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_spanName

        public void getTraces_spanName()
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_spanName_noServiceName

        public void getTraces_spanName_noServiceName()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_spanName_128

        public void getTraces_spanName_128()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_tags

        public void getTraces_tags()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_minDuration

        public void getTraces_minDuration()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_lateDuration

        public void getTraces_lateDuration()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTraces_maxDuration

        public void getTraces_maxDuration()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readback_minimalErrorSpan

        public void readback_minimalErrorSpan()
                                       throws java.lang.Exception
        The following skeletal span is used in dependency linking.

        Notably this guards empty tag values work

        Throws:
        java.lang.Exception
      • readsBackLargeValues

        public void readsBackLargeValues()
                                  throws java.io.IOException
        While large spans are discouraged, and maybe not indexed, we should be able to read them back.
        Throws:
        java.io.IOException
      • spanNameIsJson

        public void spanNameIsJson()
                            throws java.io.IOException
        Not a good span name, but better to test it than break mysteriously
        Throws:
        java.io.IOException
      • tagsWithNestedDots

        public void tagsWithNestedDots()
                                throws java.io.IOException
        Dots in tag names can create problems in storage which tries to make a tree out of them
        Throws:
        java.io.IOException
      • getTraces_manyTraces

        public void getTraces_manyTraces()
                                  throws java.io.IOException
        Formerly, a bug was present where cassandra didn't index more than bucket count traces per millisecond. This stores a lot of spans to ensure indexes work under high-traffic scenarios.
        Throws:
        java.io.IOException
      • getTraces_duration

        public void getTraces_duration()
                                throws java.io.IOException
        Shows that duration queries go against the root span, not the child
        Throws:
        java.io.IOException
      • getTraces_absentWhenNoTimestamp

        public void getTraces_absentWhenNoTimestamp()
                                             throws java.io.IOException
        Spans and traces are meaningless unless they have a timestamp. While unlikely, this could happen if a binary annotation is logged before a timestamped one is.
        Throws:
        java.io.IOException
      • getTraces_annotation

        public void getTraces_annotation()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getTraces_multipleAnnotationsBecomeAndFilter

        public void getTraces_multipleAnnotationsBecomeAndFilter()
                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getTraces_differentiateOnServiceName

        public void getTraces_differentiateOnServiceName()
                                                  throws java.io.IOException
        This test makes sure that annotation queries pay attention to which host recorded data
        Throws:
        java.io.IOException
      • getTraces_limit

        public void getTraces_limit()
                             throws java.io.IOException
        limit should apply to traces closest to endTs
        Throws:
        java.io.IOException
      • getTraces_endTsAndLookback

        public void getTraces_endTsAndLookback()
                                        throws java.io.IOException
        Traces whose root span has timestamps between (endTs - lookback) and endTs are returned
        Throws:
        java.io.IOException
      • traceWithManySpans

        public void traceWithManySpans()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • remoteServiceName_goesLowercase

        public void remoteServiceName_goesLowercase()
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • spanName_goesLowercase

        public void spanName_goesLowercase()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • serviceNamesGoLowercase

        public void serviceNamesGoLowercase()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getTraces_endTsInsideTheTrace

        public void getTraces_endTsInsideTheTrace()
                                           throws java.io.IOException
        Ensure complete traces are aggregated, even if they complete after endTs
        Throws:
        java.io.IOException
      • accept

        protected void accept​(java.util.List<zipkin2.Span> spans)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • accept

        protected void accept​(zipkin2.Span... spans)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • requestBuilder

        protected static zipkin2.storage.QueryRequest.Builder requestBuilder()