Class TracerSpecific
- java.lang.Object
-
- com.lightbend.cinnamon.opentracing.TracerSpecific
-
public abstract class TracerSpecific extends java.lang.Object
Tracer-specific methods not exposed by OpenTracing API.
-
-
Field Summary
Fields Modifier and Type Field Description static TracerSpecific
DEFAULT
Default implementation of Tracer-specific methods.
-
Constructor Summary
Constructors Constructor Description TracerSpecific()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activateScope(io.opentracing.ScopeManager scopeManager, io.opentracing.Span span, io.opentracing.Scope scope)
Called when Cinnamon activates the scope.void
deactivateScope(io.opentracing.Span span, io.opentracing.Scope scope)
Called when Cinnamon deactivates the scope.java.lang.String
getTraceId(io.opentracing.SpanContext context)
Get the trace id string for a span context.abstract boolean
isDebug(io.opentracing.SpanContext context)
Check whether a span context is in debug mode (force sampled).abstract boolean
isSampled(io.opentracing.SpanContext context)
Check whether a span context is sampled.io.opentracing.SpanContext
newSpanContextCreated(io.opentracing.SpanContext spanContext)
Called when a new SpanContext is created.boolean
spansEqual(io.opentracing.Span span1, io.opentracing.Span span2)
Compare whether the spans equal.
-
-
-
Field Detail
-
DEFAULT
public static final TracerSpecific DEFAULT
Default implementation of Tracer-specific methods.
-
-
Method Detail
-
isSampled
public abstract boolean isSampled(io.opentracing.SpanContext context)
Check whether a span context is sampled.- Parameters:
context
- the SpanContext to check for sampling- Returns:
- whether the context is sampled
-
isDebug
public abstract boolean isDebug(io.opentracing.SpanContext context)
Check whether a span context is in debug mode (force sampled).- Parameters:
context
- the SpanContext to check for debug- Returns:
- whether the context is in debug mode
-
getTraceId
public java.lang.String getTraceId(io.opentracing.SpanContext context)
Get the trace id string for a span context.- Parameters:
context
- the SpanContext- Returns:
- the trace id as a string
-
spansEqual
public boolean spansEqual(io.opentracing.Span span1, io.opentracing.Span span2)
Compare whether the spans equal.- Parameters:
span1
- - a spanspan2
- - another span- Returns:
- true if the spans equal, otherwise false
-
activateScope
public void activateScope(io.opentracing.ScopeManager scopeManager, io.opentracing.Span span, io.opentracing.Scope scope)
Called when Cinnamon activates the scope. It's primarily used for better Datadog tracer integration to notify it to capture currently activate context. For each call to this method Cinnamon calls deactivateScope when it's about to deactivate the scope.- Parameters:
scopeManager
- - a scope managerspan
- - an activated spanscope
- - an activated scope
-
deactivateScope
public void deactivateScope(io.opentracing.Span span, io.opentracing.Scope scope)
Called when Cinnamon deactivates the scope. See activateScope. Cinnamon can call activate method multiple time and it will call this method as many times. Note, that implementation should count nested scopes to run necessary deactivation action only when the most outer scope is deactivated.- Parameters:
span
- - an activated spanscope
- - an activated scope
-
newSpanContextCreated
public io.opentracing.SpanContext newSpanContextCreated(io.opentracing.SpanContext spanContext)
Called when a new SpanContext is created.NOTE: currently it's only called by Jaeger tracer to plug-in AWS X-Ray ID support.
- Parameters:
spanContext
- - new SpanContext- Returns:
- changed or original spanContext
-
-