Span as the active instance for the current
context (usually a thread).ScopeManager.activate(Span) instead.
Set the specified Span as the active instance for the current
context (usually a thread).
Finishing the Span upon Scope.close() is discouraged,
as reporting errors becomes impossible:
try (Scope scope = tracer.scopeManager().activate(span, true)) {
} catch (Exception e) {
// Not possible to report errors, as
// the span has been already finished.
}
Span instance active for the current context (usually a thread).ScopeManager.activeSpan() instead.
Return the currently active Scope which can be used to deactivate the currently active
Span.
Observe that Scope is expected to be used only in the same thread where it was
created, and thus should not be passed across threads.
Because both ScopeManager.active() and ScopeManager.activeSpan() reference the current
active state, they both will be either null or non-null.
Span.Format.Builtin.BINARY but specific for calling Tracer.extract(io.opentracing.propagation.Format<C>, C) with.Format.Builtin.BINARY but specific for calling Tracer.inject(io.opentracing.SpanContext, io.opentracing.propagation.Format<C>, C) with.BinaryExtract is an interface defining the required operations for a binary carrier for
Tracer.extract(io.opentracing.propagation.Format<C>, C) only.BinaryInject is an interface defining the required operations for a binary carrier for
Tracer.inject(io.opentracing.SpanContext, io.opentracing.propagation.Format<C>, C) only.Scope, updating ScopeManager.active() and ScopeManager.activeSpan()
in the process.SpanContext extraction.References.CHILD_OF reference to the ScopeManager.activeSpan()).SpanContext injection.Binary instance used for injection with the
specified ByteBuffer as output.ScopeManager interface abstracts both the activation of Span instances via
ScopeManager.activate(Span) and access to an active Span
via ScopeManager.activeSpan().Span.setTag(String, String), but for boolean values.Span.setTag(String, String), but for numeric values.Span.setTag(String, String), but with using TagSpan directly or access it through ScopeManager.activeSpan()
Return the corresponding active Span for this instance.Span represents the OpenTracing specification's Span contract.Span.Tracer.SpanBuilder.start() and ScopeManager.activate(Span span) instead.
Returns a newly started and activated Scope.
SpanBuilder#startActive() is a shorthand for
tracer.scopeManager().activate(spanBuilder.start()).
The returned Scope supports try-with-resources, but using this method is
discouraged as the Span reference could be easily lost, and reporting
errors on Span through this method becomes impossible:
try (Scope scope = tracer.buildSpan("...").startActive(true)) {
// (Do work)
scope.span().setTag( ... ); // etc, etc
} catch (Exception e) {
// Not possible to report errors, as
// the span reference has been lost,
// and span has been already finished too.
}
It is recommended to use Tracer.SpanBuilder.start() with a subsequent call to
ScopeManager.activate(Span)
Span span = tracer.buildSpan("...").start();
try (Scope scope = tracer.activateSpan(span)) {
} catch (Exception e) {
span.log(...); // Report any errors properly.
} finally {
span.finish(); // Optionally close the Span.
}
Tracer.SpanBuilder.start() instead.Format.Builtin.TEXT_MAP but specific for calling Tracer.extract(io.opentracing.propagation.Format<C>, C) with.Format.Builtin.TEXT_MAP but specific for calling Tracer.inject(io.opentracing.SpanContext, io.opentracing.propagation.Format<C>, C) with.TextMapExtract is a built-in carrier for Tracer.extract(io.opentracing.propagation.Format<C>, C) only.TextMapInject is a built-in carrier for Tracer.inject(io.opentracing.SpanContext, io.opentracing.propagation.Format<C>, C) only.Span.setTag(String, String), but for the span being built.Span.setTag(String, boolean), but for the span being built.Span.setTag(String, Number), but for the span being built.AbstractTag#set(Span, T), but for the span being built.Copyright © 2016–2019 OpenTracing. All rights reserved.