Interface Tracer
- All Known Implementing Classes:
OtlpTracer
public interface Tracer
Where spans come from and where they go.
The server is instrumented against this interface and nothing else, so a
binary that installs no tracer carries no tracing implementation: the
translator keeps a class only when something reaches it, and the one
implementation, com.codename1.backend.otel.OtlpTracer, is reached only
from the entry point the build generates for a project that asks for it (see
@OpenTelemetry).
-
Method Summary
Modifier and TypeMethodDescriptionvoidflush(int timeoutMillis) Blocks until what has ended so far is exported, or the time runs out.voidAdds this tracer's counters to a metrics snapshot.booleanReads the settings and starts whatever exports spans.relay()The handler that relays client spans to the collector, or null when this deployment does not offer one.voidshutdown(int timeoutMillis) Flushes, then stops the exporter.A new span.
-
Method Details
-
open
Reads the settings and starts whatever exports spans. Called once, byBackend.Builder.start()or by the application beforeTracing.install(Tracer).- Returns:
- false when the configuration turned tracing off, in which case the tracer is not installed and nothing was started
- Throws:
IOException
-
startSpan
A new span. Never null: a span the sampler declines is a non-recording one that still carries its trace context.- Parameters:
parent- the local parent, or nulltraceparent- a remote parent'straceparentheader, used whenparentis null; null or malformed starts a new tracetracestate- the remote parent'stracestate, or null
-
flush
void flush(int timeoutMillis) Blocks until what has ended so far is exported, or the time runs out. A Lambda host freezes the process between invocations, so a background exporter there only runs when something waits for it. -
shutdown
void shutdown(int timeoutMillis) Flushes, then stops the exporter. -
relay
HttpServer.Handler relay()The handler that relays client spans to the collector, or null when this deployment does not offer one. The builder puts it ahead of the routers. -
metrics
Adds this tracer's counters to a metrics snapshot.
-