Span is a single unit of work that needs to be started and stopped. Contains timing information and events and tags.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Span.Builder
In some cases (e.g. when dealing with
|
| public static enum | Span.Kind
Type of span. |
| Modifier and Type | Field and Description |
|---|---|
| public static final Span | NOOP
A noop implementation.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public TraceContext | |
| public void | |
| public void | |
| public Span | |
| public Span | Returns: this spanevent name to set on the span value)Redeclares io. |
| public Span | |
| public boolean | Returns: true when no recording is done and nothing is reported to an
external system. However, this span should still be injected into outgoing
requests. Use this flag to avoid performing expensive computation.
|
| public Span | Returns: this spanname to set on the span name)Redeclares io. |
| public Span | Returns: this spanremote ip ip, int remote port port)Sets the remote url on the span. |
| public Span | Returns: this spanremote service name remoteServiceName)Sets the remote service name for the span. |
| public Span | |
| public Span | Returns: this spantag key key, String tag value value)Redeclares io. |
| public default Span | Returns: this spantag key key, long tag value value)Overrides default io. |
| public default Span | Returns: this spantag key key, double tag value value)Overrides default io. |
| public default Span | Returns: this spantag key key, boolean tag value value)Overrides default io. |
| NOOP | back to summary |
|---|---|
| public static final Span NOOP Hides io. A noop implementation. | |
| abandon | back to summary |
|---|---|
| public void abandon() Ends the span. The span gets stopped but does not get recorded. | |
| context | back to summary |
|---|---|
public TraceContext context()
| |
| end | back to summary |
|---|---|
| public void end() Ends the span. The span gets stopped and recorded if not noop. | |
| end | back to summary |
|---|---|
| public void end(long time, TimeUnit timeUnit) Ends the span. The span gets stopped and recorded if not noop.
| |
| error | back to summary |
|---|---|
| public Span error(Throwable throwable) Records an exception for this span. | |
| event | back to summary |
|---|---|
| public Span event(String value) Redeclares io. Sets an event on this span. | |
| event | back to summary |
|---|---|
| public Span event(String value, long time, TimeUnit timeUnit) Sets an event on this span. | |
| isNoop | back to summary |
|---|---|
public boolean isNoop()
| |
| name | back to summary |
|---|---|
| public Span name(String name) Redeclares io. Sets a name on this span. | |
| remoteIpAndPort | back to summary |
|---|---|
| public Span remoteIpAndPort(String ip, int port) Sets the remote url on the span. | |
| remoteServiceName | back to summary |
|---|---|
| public Span remoteServiceName(String remoteServiceName) Sets the remote service name for the span. | |
| start | back to summary |
|---|---|
| public Span start() Starts this span.
| |
| tag | back to summary |
|---|---|
| public Span tag(String key, String value) Redeclares io. Sets a tag on this span. | |
| tag | back to summary |
|---|---|
| public default Span tag(String key, long value) Overrides default io. Sets a tag on this span. | |
| tag | back to summary |
|---|---|
| public default Span tag(String key, double value) Overrides default io. Sets a tag on this span. | |
| tag | back to summary |
|---|---|
| public default Span tag(String key, boolean value) Overrides default io. Sets a tag on this span. | |
Propagator#extract(Object, Propagator.Getter) 's we want to create a span
that has not yet been started, yet it's heavily configurable (some options are not
possible to be set when a span has already been started). We can achieve that by
using a builder.
Inspired by OpenZipkin Brave and OpenTelemetry API.
| Modifier and Type | Field and Description |
|---|---|
| public static final Span. | NOOP
A noop implementation. |
| Modifier and Type | Method and Description |
|---|---|
| public default Span. | |
| public Span. | |
| public Span. | |
| public Span. | |
| public Span. | |
| public Span. | Returns: thisremote service ip ip, int remote service port port)Sets the remote URL for the span. |
| public Span. | Returns: thisremote service name remoteServiceName)Sets the remote service name for the span. |
| public Span. | |
| public Span. | |
| public Span | |
| public Span. | Returns: thisstart timestamp startTimestamp, TimeUnit start time unit unit)Sets start timestamp. |
| public Span. | |
| public default Span. | |
| public default Span. | |
| public default Span. |
| NOOP | back to summary |
|---|---|
| public static final Span. A noop implementation. | |
| addLink | back to summary |
|---|---|
| public default Span. Adds a link to the newly created
Links are used to link | |
| error | back to summary |
|---|---|
| public Span. Sets an error on the span. | |
| event | back to summary |
|---|---|
| public Span. Sets an event on the span. | |
| kind | back to summary |
|---|---|
| public Span. Sets the kind on the span. | |
| name | back to summary |
|---|---|
| public Span. Sets the name of the span. | |
| remoteIpAndPort | back to summary |
|---|---|
| public Span. Sets the remote URL for the span. | |
| remoteServiceName | back to summary |
|---|---|
| public Span. Sets the remote service name for the span. | |
| setNoParent | back to summary |
|---|---|
| public Span. Sets no parent of the built span. | |
| setParent | back to summary |
|---|---|
| public Span. Sets the parent of the built span.
| |
| start | back to summary |
|---|---|
| public Span start() Builds and starts the span.
| |
| startTimestamp | back to summary |
|---|---|
| public Span. Sets start timestamp. | |
| tag | back to summary |
|---|---|
| public Span. Sets a tag on the span. | |
| tag | back to summary |
|---|---|
| public default Span. Sets a tag on the span. | |
| tag | back to summary |
|---|---|
| public default Span. Sets a tag on the span. | |
| tag | back to summary |
|---|---|
| public default Span. Sets a tag on the span. | |
Documentation of the enum taken from OpenTelemetry.
| Modifier and Type | Field and Description |
|---|---|
| public static final Span. | CLIENT
Indicates that the span covers the client-side wrapper around an RPC or other remote request. |
| public static final Span. | CONSUMER
Indicates that the span describes consumer receiving a message from a broker. |
| public static final Span. | PRODUCER
Indicates that the span describes producer sending a message to a broker. |
| public static final Span. | SERVER
Indicates that the span covers server-side handling of an RPC or other remote request. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Span. | |
| public static Span. |
| CLIENT | back to summary |
|---|---|
| public static final Span. Indicates that the span covers the client-side wrapper around an RPC or other remote request. | |
| CONSUMER | back to summary |
|---|---|
| public static final Span. Indicates that the span describes consumer receiving a message from a broker. Unlike client and server, there is no direct critical path latency relationship between producer and consumer spans. | |
| PRODUCER | back to summary |
|---|---|
| public static final Span. Indicates that the span describes producer sending a message to a broker. Unlike client and server, there is no direct critical path latency relationship between producer and consumer spans. | |
| SERVER | back to summary |
|---|---|
| public static final Span. Indicates that the span covers server-side handling of an RPC or other remote request. | |
| Kind | back to summary |
|---|---|
| private Kind() | |
| valueOf | back to summary |
|---|---|
| public static Span. | |
| values | back to summary |
|---|---|
| public static Span. | |