public interface TracerObserver
Spans.| Modifier and Type | Method and Description |
|---|---|
SpanObserver |
onStart(SpanData spanData)
Notifies the observer that a new span has been started with the supplied data.
|
SpanObserver onStart(SpanData spanData)
An observer can either be implemented as stateful or stateless:
* A stateful implementation should return a new instance of a SpanObserver implementation
for each span that is started, allowing this implementation to locally maintain
information about that span as subsequent SpanObserver methods are called. For example,
where the observer is interested in a sequence of events associated with the span, such as the
recording of a new tag initiating a metric which then needs to be completed/recorded when the
span is finished.
* A stateless implementation should return a singleton instance
of the SpanObserver. Each call to the observer will be handled in isolation. For example,
this approach would be useful when only interested in a specific event - such as
a onLog event which can result in the log details being recorded
to a logging framework, or onFinish
being used to record metrics about the duration of the span.
spanData - The data for the span that has been startedSpanCopyright © 2017–2018 OpenTracing. All rights reserved.