APITracer class
Tracer is responsible for creating APISpans and propagating context in-process. The API prefix indicates that it's part of the API and not the SDK and generally should not be used since an API without an SDK is a noop. Use the TracerProvider from the SDK instead.
Properties
- attributes ↔ Attributes?
-
Optional attributes associated with this tracer.
getter/setter pair
- currentSpan → APISpan?
-
Gets the currently active span from the current context
no setter
- enabled → bool
-
Returns true if the tracer is enabled and will create sampling spans.
This should be checked before performing expensive operations to create spans.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- name → String
-
Gets the name of the tracer, usually of a library, package or module
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaUrl → String?
-
Gets the schema URL of the tracer
final
- version → String?
-
Gets the version, usually of the instrumented library, package or module
final
Methods
-
createSpan(
{required String name, SpanContext? spanContext, APISpan? parentSpan, SpanKind kind = SpanKind.internal, Attributes? attributes, List< SpanLink> ? links, List<SpanEvent> ? spanEvents, DateTime? startTime, bool? isRecording, Context? context}) → APISpan - Creates a span with specific options Creates a span with the specified parameters without making it active in any context.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startSpan(
String name, {Context? context, SpanContext? spanContext, APISpan? parentSpan, SpanKind kind = SpanKind.internal, Attributes? attributes, List< SpanLink> ? links, bool? isRecording = true}) → APISpan - Starts a new APISpan.
-
toString(
) → String -
A string representation of this object.
inherited
-
withSpan<
T> (APISpan span, T fn()) → T - Executes the provided function with the given span active in the current context. The span remains active only for the duration of the function.
-
withSpanAsync<
T> (APISpan span, Future< T> fn()) → Future<T> - Executes the provided async function with the given span active in the current context. The span remains active throughout the entire async execution.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override