Package org.deltafi.common.trace
Class ZipkinService
- java.lang.Object
-
- org.deltafi.common.trace.ZipkinService
-
public class ZipkinService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ZipkinService(ZipkinProperties zipkinProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateAndSendRootSpan(java.lang.String did, java.time.OffsetDateTime created, java.lang.String fileName, java.lang.String flow)Create a span that represents the entire lifecycle of the given deltaFile.DeltafiSpancreateChildSpan(java.lang.String did, java.lang.String actionName, java.lang.String fileName, java.lang.String flow)Create a span that represents the lifecycle of the deltaFile going through the given action.DeltafiSpancreateChildSpan(java.lang.String did, java.lang.String actionName, java.lang.String fileName, java.lang.String flow, java.time.OffsetDateTime created)Create a span that represents the lifecycle of the deltaFile going through the given action.booleanisEnabled()voidmarkSpanComplete(DeltafiSpan span)Set the duration of the span based on the current time and send the span to the zipkin backend.voidsendQueuedSpans()voidshutdown()
-
-
-
Constructor Detail
-
ZipkinService
public ZipkinService(ZipkinProperties zipkinProperties)
-
-
Method Detail
-
shutdown
@PreDestroy public void shutdown()
-
createAndSendRootSpan
public void createAndSendRootSpan(java.lang.String did, java.time.OffsetDateTime created, java.lang.String fileName, java.lang.String flow)Create a span that represents the entire lifecycle of the given deltaFile. This should be fired when the DeltaFile hits a terminal state.- Parameters:
did- DeltaFile idcreated- time of the deltaFile creationfileName- original fileNameflow- flow that this deltaFile belongs too
-
createChildSpan
public DeltafiSpan createChildSpan(java.lang.String did, java.lang.String actionName, java.lang.String fileName, java.lang.String flow)
Create a span that represents the lifecycle of the deltaFile going through the given action.- Parameters:
did- DeltaFile idactionName- Action acting on the deltaFile in this spanfileName- original fileNameflow- flow that this deltaFile belongs too- Returns:
- The span for the deltaFile going through the action
-
createChildSpan
public DeltafiSpan createChildSpan(java.lang.String did, java.lang.String actionName, java.lang.String fileName, java.lang.String flow, java.time.OffsetDateTime created)
Create a span that represents the lifecycle of the deltaFile going through the given action.- Parameters:
did- DeltaFile idactionName- Action acting on the deltaFile in this spanfileName- original fileNameflow- flow that this deltaFile belongs toocreated- optional timestamp- Returns:
- The span for the deltaFile going through the action
-
markSpanComplete
public void markSpanComplete(DeltafiSpan span)
Set the duration of the span based on the current time and send the span to the zipkin backend.- Parameters:
span- span to finish and send
-
sendQueuedSpans
public void sendQueuedSpans()
-
isEnabled
public boolean isEnabled()
-
-