Package zipkin2.storage
Class ITDependencies<T extends StorageComponent>
java.lang.Object
zipkin2.storage.ITStorage<T>
zipkin2.storage.ITDependencies<T>
@TestInstance(PER_CLASS) public abstract class ITDependencies<T extends StorageComponent> extends ITStorage<T>
Base test for
SpanStore implementations that support dependency aggregation. Subtypes
should create a connection to a real backend, even if that backend is in-process.
This is a replacement for zipkin.storage.DependenciesTest. There is some redundancy
as zipkin2.internal.DependencyLinkerTest also defines many of these tests. The redundancy
helps ensure integrated storage doesn't fail due to mismapping of data, for example.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ITDependencies() -
Method Summary
Modifier and Type Method Description protected Map<Long,List<DependencyLink>>aggregateLinks(List<Span> spans)Returns links aggregated by midnightprotected voidannotationNamedErrorIsntError()A timeline annotation named error is not a failed span.protected voidcanSearchForIntervalsBesidesToday()This test shows that dependency links can be filtered at daily granularity.protected voidconfigureStorageForTest(StorageComponent.Builder storage)Configures aStorageComponent.Builderwith parameters for the test being executed.protected voiddependencies_headlessTrace()Some systems log a different trace id than the root span.protected voiddependencies_loopback()protected voidduplicateAddress()This test confirms that the span store can process trace with intermediate spans like the below properly.protected voidempty()Edge-case when there are no spans, or instrumentation isn't logging annotations properly.protected voidendTimeBeforeData()protected voidendTsAndLookbackMustBePositive()protected voidendTsInsideTheTrace()Ensure complete traces are aggregated, even if they complete after endTsprotected voidgetDependencies()Normally, the root-span is where trace id == span id and parent id == null.protected voidgetDependencies_strictTraceId()This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links.protected voidgetDependenciesAllInstrumented()When all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.protected voidinstrumentedClientAndServer()protected voidinstrumentedProducerAndConsumer()protected voidintermediateSpans()This test confirms that the span store can process trace with intermediate spans like the below properly.protected voidlookbackAfterData()protected voidlooksBackIndefinitely()protected voidmanyLinks()Ensure there's no query limit problem around linksprotected voidmissingIntermediateSpan()This shows a missing parent still results in a dependency link when local endpoints changeprotected voidnotInstrumentedClientAndServer()This test confirms that the span store can detect dependency indicated by local and remote endpoint.protected voidoneway()Span starts on one host and ends on the other.protected voidoneway_noClient()Async span starts from an uninstrumented source.protected voidprocessDependencies(List<Span> spans)Override if dependency processing is a separate job: it should complete before returning from this method.protected voidreplayOverwrites()It should be safe to run dependency link jobs twiceprotected voidspanKindIsNotRequiredWhenEndpointsArePresent()protected voidtraceIdIsOpaque()Trace id is not required to be a span id.protected voidunnamedEndpointsAreSkipped()Methods inherited from class zipkin2.storage.ITStorage
accept, accept, blockWhileInFlight, clear, initializeStoragePerTest, names, newStorageBuilder, store, traces
-
Constructor Details
-
ITDependencies
public ITDependencies()
-
-
Method Details
-
configureStorageForTest
Description copied from class:ITStorageConfigures aStorageComponent.Builderwith parameters for the test being executed.- Specified by:
configureStorageForTestin classITStorage<T extends StorageComponent>
-
processDependencies
Override if dependency processing is a separate job: it should complete before returning from this method.- Throws:
Exception
-
getDependencies
Normally, the root-span is where trace id == span id and parent id == null. The default is to look back one day from today.- Throws:
Exception
-
getDependencies_strictTraceId
This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links. This allows environments with 64-bit instrumentation to participate in the same trace as 128-bit instrumentation.- Throws:
Exception
-
replayOverwrites
It should be safe to run dependency link jobs twice- Throws:
Exception
-
empty
Edge-case when there are no spans, or instrumentation isn't logging annotations properly.- Throws:
Exception
-
traceIdIsOpaque
Trace id is not required to be a span id. For example, some instrumentation may create separate trace ids to help with collisions, or to encode information about the origin. This test makes sure we don't rely on the trace id = root span id convention.- Throws:
Exception
-
getDependenciesAllInstrumented
When all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.- Throws:
Exception
-
dependencies_loopback
- Throws:
Exception
-
dependencies_headlessTrace
Some systems log a different trace id than the root span. This seems "headless", as we won't see a span whose id is the same as the trace id.- Throws:
Exception
-
looksBackIndefinitely
- Throws:
Exception
-
endTsInsideTheTrace
Ensure complete traces are aggregated, even if they complete after endTs- Throws:
Exception
-
endTimeBeforeData
- Throws:
Exception
-
lookbackAfterData
- Throws:
Exception
-
notInstrumentedClientAndServer
This test confirms that the span store can detect dependency indicated by local and remote endpoint. Specifically, this detects an uninstrumented client before the trace and an uninstrumented server at the end of it.- Throws:
Exception
-
endTsAndLookbackMustBePositive
- Throws:
IOException
-
instrumentedClientAndServer
- Throws:
Exception
-
instrumentedProducerAndConsumer
- Throws:
Exception
-
manyLinks
Ensure there's no query limit problem around links- Throws:
Exception
-
missingIntermediateSpan
This shows a missing parent still results in a dependency link when local endpoints change- Throws:
Exception
-
canSearchForIntervalsBesidesToday
This test shows that dependency links can be filtered at daily granularity. This allows the UI to look for dependency intervals besides TODAY.- Throws:
Exception
-
spanKindIsNotRequiredWhenEndpointsArePresent
- Throws:
Exception
-
unnamedEndpointsAreSkipped
- Throws:
Exception
-
intermediateSpans
This test confirms that the span store can process trace with intermediate spans like the below properly. span1: SR SS span2: intermediate call span3: CS SR SS CR: Dependency 1- Throws:
Exception
-
duplicateAddress
This test confirms that the span store can process trace with intermediate spans like the below properly. span1: SR SS span2: intermediate call span3: CS SR SS CR: Dependency 1- Throws:
Exception
-
oneway
Span starts on one host and ends on the other. In both cases, a response is neither sent nor received.- Throws:
Exception
-
annotationNamedErrorIsntError
A timeline annotation named error is not a failed span. A tag/binary annotation is.- Throws:
Exception
-
oneway_noClient
Async span starts from an uninstrumented source.- Throws:
Exception
-
aggregateLinks
Returns links aggregated by midnight
-