api library
Classes
- Attribute
- A representation of a single piece of metadata attached to trace span.
- Context
- ContextKey
- A key used to set and get values from a Context.
- IdGenerator
- Generator capable of creating OTel compliant IDs.
- InstrumentationLibrary
- Represents versioning metadata for this library within applications which use multiple implementations of OpenTelemetry.
- ResourceAttributes
- Common OpenTelemetry attribute keys for resource information.
- SemanticAttributes
- Common OpenTelemetry attribute keys for non-resource information.
- Span
- A representation of a single operation within a trace.
- SpanContext
- Representation of the context of an individual span.
- SpanEvent
- A representation of a collection of metadata attached to a trace span.
- SpanExporter
- SpanId
- Class representing an ID for a single api.Span. See https://www.w3.org/TR/trace-context/#parent-id for full specification.
- SpanLink
- SpanProcessor
- SpanStatus
- A representation of the status of a Span.
-
TextMapGetter<
C> - Interface that allows a api.TextMapPropagator to read propagated fields from a carrier.
-
TextMapPropagator<
C> - A class responsible for performing the injection and extraction of a cross-cutting concern value as string key/values pairs into carriers that travel across process boundaries.
-
TextMapSetter<
C> - Class that allows a api.TextMapPropagator to set propagated fields into a carrier.
- TraceFlags
- A class which controls tracing flags for sampling, trace level, and so forth. See https://www.w3.org/TR/trace-context/#trace-flags for full specification.
- TraceId
- Class representing an ID for a single Trace. See https://www.w3.org/TR/trace-context/#trace-id for full specification.
- Tracer
- An interface for creating api.Spans and propagating context in-process.
- TracerProvider
- A registry for creating named api.Tracers.
- TraceState
- Representation of the state of a trace.
- W3CTraceContextPropagator
Enums
- SpanKind
- StatusCode
- The set of canonical status codes.
Properties
- globalContextManager → ContextManager
-
no setter
- globalTextMapPropagator → TextMapPropagator
-
no setter
- globalTracerProvider → TracerProvider
-
no setter
Functions
-
contextWithSpan(
Context parent, Span span) → Context -
contextWithSpanContext(
Context parent, SpanContext spanContext) → Context -
registerGlobalContextManager(
ContextManager contextManager) → void -
registerGlobalTextMapPropagator(
TextMapPropagator textMapPropagator) → void -
registerGlobalTracerProvider(
TracerProvider tracerProvider) → void -
spanContextFromContext(
Context context) → SpanContext -
spanFromContext(
Context context) → Span -
trace<
T> (String name, Future< T> fn(), {Context? context, Tracer? tracer, bool newRoot = false, SpanKind spanKind = api.SpanKind.internal, List<SpanLink> spanLinks = const []}) → Future<T> -
Records a span of the given
name
for the given function with a given api.Tracer and marks the span as errored if an exception occurs. -
traceContext<
T> (String name, Future< T> fn(Context), {Context? context, Tracer? tracer, bool newRoot = false, SpanKind spanKind = api.SpanKind.internal, List<SpanLink> spanLinks = const []}) → Future<T> -
Records a span of the given
name
for the given function with a given api.Tracer and marks the span as errored if an exception occurs. -
traceContextSync<
T> (String name, T fn(Context), {Context? context, Tracer? tracer, bool newRoot = false, SpanKind spanKind = api.SpanKind.internal, List< SpanLink> spanLinks = const []}) → T -
Use traceContextSync instead of traceContext when
fn
is not an async function. -
traceSync<
T> (String name, T fn(), {Context? context, Tracer? tracer, bool newRoot = false, SpanKind spanKind = api.SpanKind.internal, List< SpanLink> spanLinks = const []}) → T -
Use traceSync instead of trace when
fn
is not an async function. -
zone(
[Context? context]) → Zone - Returns a new Zone such that the given context will be automatically attached and detached for any function that runs within the zone.