Package sonia.scm.trace
Class Tracer
java.lang.Object
sonia.scm.trace.Tracer
The tracer api allows the tracing of long running tasks, such as calling external systems.
The api is able to collect tracing points called spans.
To use the tracer api inject the
Tracer
and open a span in a try with resources block e.g.:
try (Span span = tracer.span("jenkins").label("repository", "builds/core")) { Response response = jenkins.call("http://..."); if (!response.isSuccess()) { span.label("reason", response.getFailedReason()); span.failed(); } }As seen in the example we can mark span as failed and add more context to the span with labels. After a span is closed it is delegated to an
Exporter
, which- Since:
- 2.9.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Tracer
-
-
Method Details
-
span
Creates a new span.- Parameters:
kind
- kind of span
-