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
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Long,
List<DependencyLink>> aggregateLinks
(List<Span> spans) Returns links aggregated by midnightprotected void
annotationNamedErrorIsntError
(org.junit.jupiter.api.TestInfo testInfo) A timeline annotation named error is not a failed span.protected void
canSearchForIntervalsBesidesToday
(org.junit.jupiter.api.TestInfo testInfo) This test shows that dependency links can be filtered at daily granularity.protected final void
Configures aStorageComponent.Builder
with parameters for the test being executed.protected void
dependencies_headlessTrace
(org.junit.jupiter.api.TestInfo testInfo) Some systems log a different trace id than the root span.protected void
dependencies_loopback
(org.junit.jupiter.api.TestInfo testInfo) protected void
duplicateAddress
(org.junit.jupiter.api.TestInfo testInfo) 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
(org.junit.jupiter.api.TestInfo testInfo) protected void
This tests we error prior to executing the call.protected void
endTsInsideTheTrace
(org.junit.jupiter.api.TestInfo testInfo) Ensure complete traces are aggregated, even if they complete after endTsprotected void
getDependencies
(org.junit.jupiter.api.TestInfo testInfo) Normally, the root-span is where trace id == span id and parent id == null.protected void
getDependencies_linksMixedTraceId
(org.junit.jupiter.api.TestInfo testInfo) This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links.protected void
getDependenciesAllInstrumented
(org.junit.jupiter.api.TestInfo testInfo) When all servers are instrumented, they all recordSpan.Kind.SERVER
and theSpan.localEndpoint()
indicates the service.protected void
instrumentedClientAndServer
(org.junit.jupiter.api.TestInfo testInfo) protected void
instrumentedProducerAndConsumer
(org.junit.jupiter.api.TestInfo testInfo) protected void
intermediateSpans
(org.junit.jupiter.api.TestInfo testInfo) This test confirms that the span store can process trace with intermediate spans like the below properly.protected void
lookbackAfterData
(org.junit.jupiter.api.TestInfo testInfo) protected void
looksBackIndefinitely
(org.junit.jupiter.api.TestInfo testInfo) protected void
missingIntermediateSpan
(org.junit.jupiter.api.TestInfo testInfo) This shows a missing parent still results in a dependency link when local endpoints changeprotected void
notInstrumentedClientAndServer
(org.junit.jupiter.api.TestInfo testInfo) This test confirms that the span store can detect dependency indicated by local and remote endpoint.protected void
oneway
(org.junit.jupiter.api.TestInfo testInfo) Span starts on one host and ends on the other.protected void
oneway_noClient
(org.junit.jupiter.api.TestInfo testInfo) 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
(org.junit.jupiter.api.TestInfo testInfo) It should be safe to run dependency link jobs twiceprotected void
spanKindIsNotRequiredWhenEndpointsArePresent
(org.junit.jupiter.api.TestInfo testInfo) protected void
unnamedEndpointsAreSkipped
(org.junit.jupiter.api.TestInfo testInfo) Methods inherited from class zipkin2.storage.ITStorage
accept, accept, assertGetTraceReturns, assertGetTraceReturns, assertGetTraceReturnsEmpty, assertGetTracesReturns, assertGetTracesReturns, assertGetTracesReturnsCount, assertGetTracesReturnsEmpty, assertGetTracesReturnsEmpty, blockWhileInFlight, checkStorage, clear, initializeStoragePerTest, names, newStorageBuilder, requestBuilder, returnsRawSpans, sortTrace, store, testSuffix, 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_linksMixedTraceId
@Test protected void getDependencies_linksMixedTraceId(org.junit.jupiter.api.TestInfo testInfo) throws Exception 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
-
getDependenciesAllInstrumented
@Test protected void getDependenciesAllInstrumented(org.junit.jupiter.api.TestInfo testInfo) throws Exception When all servers are instrumented, they all recordSpan.Kind.SERVER
and theSpan.localEndpoint()
indicates the service.- Throws:
Exception
-
dependencies_loopback
@Test protected void dependencies_loopback(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
dependencies_headlessTrace
@Test protected void dependencies_headlessTrace(org.junit.jupiter.api.TestInfo testInfo) throws Exception 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
@Test protected void looksBackIndefinitely(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
endTsInsideTheTrace
Ensure complete traces are aggregated, even if they complete after endTs- Throws:
Exception
-
endTimeBeforeData
- Throws:
Exception
-
lookbackAfterData
- Throws:
Exception
-
notInstrumentedClientAndServer
@Test protected void notInstrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo) throws Exception 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
@Test protected void endTsAndLookbackMustBePositive()This tests we error prior to executing the call. -
instrumentedClientAndServer
@Test protected void instrumentedClientAndServer(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
instrumentedProducerAndConsumer
@Test protected void instrumentedProducerAndConsumer(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
missingIntermediateSpan
@Test protected void missingIntermediateSpan(org.junit.jupiter.api.TestInfo testInfo) throws Exception This shows a missing parent still results in a dependency link when local endpoints change- Throws:
Exception
-
canSearchForIntervalsBesidesToday
@Test protected void canSearchForIntervalsBesidesToday(org.junit.jupiter.api.TestInfo testInfo) throws Exception 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
@Test protected void spanKindIsNotRequiredWhenEndpointsArePresent(org.junit.jupiter.api.TestInfo testInfo) throws Exception - Throws:
Exception
-
unnamedEndpointsAreSkipped
@Test protected void unnamedEndpointsAreSkipped(org.junit.jupiter.api.TestInfo testInfo) throws Exception - 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
@Test protected void annotationNamedErrorIsntError(org.junit.jupiter.api.TestInfo testInfo) throws Exception 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
-