Package zipkin2.storage
Class ITDependencies
- java.lang.Object
-
- zipkin2.storage.ITDependencies
-
- Direct Known Subclasses:
ITInMemoryStorage.ITDependencies
public abstract class ITDependencies extends java.lang.ObjectBase test forSpanStoreimplementations 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 aszipkin2.internal.DependencyLinkerTestalso defines many of these tests. The redundancy helps ensure integrated storage doesn't fail due to mismapping of data, for example.
-
-
Constructor Summary
Constructors Constructor Description ITDependencies()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.Long,java.util.List<DependencyLink>>aggregateLinks(java.util.List<Span> spans)Returns links aggregated by midnightvoidannotationNamedErrorIsntError()A timeline annotation named error is not a failed span.voidcanSearchForIntervalsBesidesToday()This test shows that dependency links can be filtered at daily granularity.abstract voidclear()Clears store between tests.voiddependencies_headlessTrace()Some systems log a different trace id than the root span.voiddependencies_loopback()voidduplicateAddress()This test confirms that the span store can process trace with intermediate spans like the below properly.voidempty()Edge-case when there are no spans, or instrumentation isn't logging annotations properly.voidendTimeBeforeData()voidendTsAndLookbackMustBePositive()voidendTsInsideTheTrace()Ensure complete traces are aggregated, even if they complete after endTsvoidgetDependencies()Normally, the root-span is where trace id == span id and parent id == null.voidgetDependencies_strictTraceId()This tests that dependency linking ignores the high-bits of the trace ID when grouping spans for dependency links.voidgetDependenciesAllInstrumented()When all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.voidinstrumentedClientAndServer()voidinstrumentedProducerAndConsumer()voidintermediateSpans()This test confirms that the span store can process trace with intermediate spans like the below properly.voidlookbackAfterData()voidlooksBackIndefinitely()voidmanyLinks()Ensure there's no query limit problem around linksvoidmissingIntermediateSpan()This shows a missing parent still results in a dependency link when local endpoints changevoidnotInstrumentedClientAndServer()This test confirms that the span store can detect dependency indicated by local and remote endpoint.voidoneway()Span starts on one host and ends on the other.voidoneway_noClient()Async span starts from an uninstrumented source.protected voidprocessDependencies(java.util.List<Span> spans)Override if dependency processing is a separate job: it should complete before returning from this method.voidreplayOverwrites()It should be safe to run dependency link jobs twicevoidspanKindIsNotRequiredWhenEndpointsArePresent()protected abstract StorageComponentstorage()Should maintain state between multiple calls within a test.voidtraceIdIsOpaque()Trace id is not required to be a span id.voidunnamedEndpointsAreSkipped()
-
-
-
Method Detail
-
storage
protected abstract StorageComponent storage()
Should maintain state between multiple calls within a test.
-
clear
public abstract void clear() throws java.lang.ExceptionClears store between tests.- Throws:
java.lang.Exception
-
processDependencies
protected void processDependencies(java.util.List<Span> spans) throws java.lang.Exception
Override if dependency processing is a separate job: it should complete before returning from this method.- Throws:
java.lang.Exception
-
getDependencies
public void getDependencies() throws java.lang.ExceptionNormally, the root-span is where trace id == span id and parent id == null. The default is to look back one day from today.- Throws:
java.lang.Exception
-
getDependencies_strictTraceId
public void getDependencies_strictTraceId() throws java.lang.ExceptionThis 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:
java.lang.Exception
-
replayOverwrites
public void replayOverwrites() throws java.lang.ExceptionIt should be safe to run dependency link jobs twice- Throws:
java.lang.Exception
-
empty
public void empty() throws java.lang.ExceptionEdge-case when there are no spans, or instrumentation isn't logging annotations properly.- Throws:
java.lang.Exception
-
traceIdIsOpaque
public void traceIdIsOpaque() throws java.lang.ExceptionTrace 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:
java.lang.Exception
-
getDependenciesAllInstrumented
public void getDependenciesAllInstrumented() throws java.lang.ExceptionWhen all servers are instrumented, they all recordSpan.Kind.SERVERand theSpan.localEndpoint()indicates the service.- Throws:
java.lang.Exception
-
dependencies_loopback
public void dependencies_loopback() throws java.lang.Exception- Throws:
java.lang.Exception
-
dependencies_headlessTrace
public void dependencies_headlessTrace() throws java.lang.ExceptionSome 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:
java.lang.Exception
-
looksBackIndefinitely
public void looksBackIndefinitely() throws java.lang.Exception- Throws:
java.lang.Exception
-
endTsInsideTheTrace
public void endTsInsideTheTrace() throws java.lang.ExceptionEnsure complete traces are aggregated, even if they complete after endTs- Throws:
java.lang.Exception
-
endTimeBeforeData
public void endTimeBeforeData() throws java.lang.Exception- Throws:
java.lang.Exception
-
lookbackAfterData
public void lookbackAfterData() throws java.lang.Exception- Throws:
java.lang.Exception
-
notInstrumentedClientAndServer
public void notInstrumentedClientAndServer() throws java.lang.ExceptionThis 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:
java.lang.Exception
-
endTsAndLookbackMustBePositive
public void endTsAndLookbackMustBePositive() throws java.io.IOException- Throws:
java.io.IOException
-
instrumentedClientAndServer
public void instrumentedClientAndServer() throws java.lang.Exception- Throws:
java.lang.Exception
-
instrumentedProducerAndConsumer
public void instrumentedProducerAndConsumer() throws java.lang.Exception- Throws:
java.lang.Exception
-
manyLinks
public void manyLinks() throws java.lang.ExceptionEnsure there's no query limit problem around links- Throws:
java.lang.Exception
-
missingIntermediateSpan
public void missingIntermediateSpan() throws java.lang.ExceptionThis shows a missing parent still results in a dependency link when local endpoints change- Throws:
java.lang.Exception
-
canSearchForIntervalsBesidesToday
public void canSearchForIntervalsBesidesToday() throws java.lang.ExceptionThis test shows that dependency links can be filtered at daily granularity. This allows the UI to look for dependency intervals besides TODAY.- Throws:
java.lang.Exception
-
spanKindIsNotRequiredWhenEndpointsArePresent
public void spanKindIsNotRequiredWhenEndpointsArePresent() throws java.lang.Exception- Throws:
java.lang.Exception
-
unnamedEndpointsAreSkipped
public void unnamedEndpointsAreSkipped() throws java.lang.Exception- Throws:
java.lang.Exception
-
intermediateSpans
public void intermediateSpans() throws java.lang.ExceptionThis 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:
java.lang.Exception
-
duplicateAddress
public void duplicateAddress() throws java.lang.ExceptionThis 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:
java.lang.Exception
-
oneway
public void oneway() throws java.lang.ExceptionSpan starts on one host and ends on the other. In both cases, a response is neither sent nor received.- Throws:
java.lang.Exception
-
annotationNamedErrorIsntError
public void annotationNamedErrorIsntError() throws java.lang.ExceptionA timeline annotation named error is not a failed span. A tag/binary annotation is.- Throws:
java.lang.Exception
-
oneway_noClient
public void oneway_noClient() throws java.lang.ExceptionAsync span starts from an uninstrumented source.- Throws:
java.lang.Exception
-
aggregateLinks
protected java.util.Map<java.lang.Long,java.util.List<DependencyLink>> aggregateLinks(java.util.List<Span> spans)
Returns links aggregated by midnight
-
-