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 void
annotationNamedErrorIsntError()
A timeline annotation named error is not a failed span.protected void
canSearchForIntervalsBesidesToday()
This test shows that dependency links can be filtered at daily granularity.protected void
configureStorageForTest(StorageComponent.Builder storage)
Configures aStorageComponent.Builder
with parameters for the test being executed.protected void
dependencies_headlessTrace()
Some systems log a different trace id than the root span.protected void
dependencies_loopback()
protected void
duplicateAddress()
This test confirms that the span store can process trace with intermediate spans like the below properly.protected void
empty()
Edge-case when there are no spans, or instrumentation isn't logging annotations properly.protected void
endTimeBeforeData()
protected void
endTsAndLookbackMustBePositive()
protected void
endTsInsideTheTrace()
Ensure complete traces are aggregated, even if they complete after endTsprotected void
getDependencies()
Normally, the root-span is where trace id == span id and parent id == null.protected void
getDependencies_strictTraceId()
This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links.protected void
getDependenciesAllInstrumented()
When all servers are instrumented, they all recordSpan.Kind.SERVER
and theSpan.localEndpoint()
indicates the service.protected void
instrumentedClientAndServer()
protected void
instrumentedProducerAndConsumer()
protected void
intermediateSpans()
This test confirms that the span store can process trace with intermediate spans like the below properly.protected void
lookbackAfterData()
protected void
looksBackIndefinitely()
protected void
manyLinks()
Ensure there's no query limit problem around linksprotected void
missingIntermediateSpan()
This shows a missing parent still results in a dependency link when local endpoints changeprotected void
notInstrumentedClientAndServer()
This test confirms that the span store can detect dependency indicated by local and remote endpoint.protected void
oneway()
Span starts on one host and ends on the other.protected void
oneway_noClient()
Async span starts from an uninstrumented source.protected void
processDependencies(List<Span> spans)
Override if dependency processing is a separate job: it should complete before returning from this method.protected void
replayOverwrites()
It should be safe to run dependency link jobs twiceprotected void
spanKindIsNotRequiredWhenEndpointsArePresent()
protected void
traceIdIsOpaque()
Trace id is not required to be a span id.protected void
unnamedEndpointsAreSkipped()
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:ITStorage
Configures aStorageComponent.Builder
with parameters for the test being executed.- Specified by:
configureStorageForTest
in 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.SERVER
and 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
-