public final class StructuredDeploymentTracing extends Object implements AutoCloseable
TraceContext
, where we expect that in the hierarchy there is at most one
active context per level.
At instantiation time, APPLICATION
context is created as top-level one.
The process finishes by invoking close()
, which finishes the top-level context.
There is set of methods that match the interface of former DeploymentTracing
class, and methods, that allow
spans to be obtained, and then finished by invoking DeploymentSpan.close()
method, or via try-with-resources,
as they are AutoCloseable
.Modifier and Type | Method and Description |
---|---|
void |
addApplicationMark(DeploymentTracing.Mark mark)
Compatibility with
DeploymentTracing . |
void |
addContainerMark(String name,
DeploymentTracing.ContainerMark mark)
Compatibility with
DeploymentTracing . |
void |
addModuleMark(String moduleName,
DeploymentTracing.ModuleMark mark)
Compatibility with
DeploymentTracing . |
void |
close()
Finish the tracing by closing the root context.
|
static StructuredDeploymentTracing |
create(String appName)
Create new instance for application
|
static StructuredDeploymentTracing |
createDisabled(String appName)
Create disabled instance.
|
boolean |
isEnabled() |
static StructuredDeploymentTracing |
load(DeploymentContext context) |
void |
print(PrintStream out) |
void |
print(PrintWriter out)
Compatibility with
DeploymentTracing . |
DeploymentTracing |
register(DeploymentContext deploymentContext) |
SpanSequence |
startSequence(Enum<?> action) |
SpanSequence |
startSequence(Enum<?> action,
String componentName) |
DeploymentSpan |
startSpan(Enum<?> action)
Start a new span that will be finished by invoking its
DeploymentSpan.close() method |
DeploymentSpan |
startSpan(Enum<?> action,
String componentName)
Start a new span that will be finished by invoking its
DeploymentSpan.close() method |
DeploymentSpan |
startSpan(TraceContext.Level level,
String contextName,
Enum<?> action)
Switch to new context and start a span.
|
DeploymentSpan |
startSpan(TraceContext.Level level,
String contextName,
Enum<?> action,
String componentName)
Switch to new context and start a span.
|
TraceContext |
switchToContext(TraceContext.Level level,
String name)
Switch to new context.
|
public static StructuredDeploymentTracing create(String appName)
appName
- public static StructuredDeploymentTracing createDisabled(String appName)
startSpan
.appName
- public static StructuredDeploymentTracing load(DeploymentContext context)
public DeploymentSpan startSpan(Enum<?> action)
DeploymentSpan.close()
methodaction
- action being performedpublic DeploymentSpan startSpan(Enum<?> action, String componentName)
DeploymentSpan.close()
methodaction
- action being performedcomponentName
- optional component the action is performed uponpublic DeploymentSpan startSpan(TraceContext.Level level, String contextName, Enum<?> action)
level
- context levelcontextName
- context nameaction
- action being performedswitchToContext(TraceContext.Level, String)
,
startSpan(TraceContext.Level, String, Enum, String)
public DeploymentSpan startSpan(TraceContext.Level level, String contextName, Enum<?> action, String componentName)
level
- context levelcontextName
- context nameaction
- action being performedcomponentName
- optional component on which the action is being performedswitchToContext(TraceContext.Level, String)
,
startSpan(TraceContext.Level, String, Enum, String)
public SpanSequence startSequence(Enum<?> action)
public SpanSequence startSequence(Enum<?> action, String componentName)
public TraceContext switchToContext(TraceContext.Level level, String name)
level
- Level of the new contextname
- Name of the levelpublic void addModuleMark(String moduleName, DeploymentTracing.ModuleMark mark)
DeploymentTracing
. Creates span that starts at end of previous span, and ends now.mark
- public void close()
close
in interface AutoCloseable
public boolean isEnabled()
public DeploymentTracing register(DeploymentContext deploymentContext)
public void print(PrintWriter out)
DeploymentTracing
. Finishes tracing and prints out tabular lists of spanspublic void print(PrintStream out)
public void addApplicationMark(DeploymentTracing.Mark mark)
DeploymentTracing
. Creates span that starts at end of previous span, and ends now.mark
- public void addContainerMark(String name, DeploymentTracing.ContainerMark mark)
DeploymentTracing
. Creates span that starts at end of previous span, and ends now.mark
- Copyright © 2019. All rights reserved.