Categorygo.opentelemetry.io/otel/trace
modulepackage
1.35.0
Repository: https://github.com/open-telemetry/opentelemetry-go.git
Documentation: pkg.go.dev

# README

Trace API

PkgGoDev

# Packages

Package embedded provides interfaces embedded within the [OpenTelemetry trace API].
Package noop provides an implementation of the OpenTelemetry trace API that produces no telemetry and minimizes used computation resources.

# Functions

ContextWithRemoteSpanContext returns a copy of parent with rsc set explicitly as a remote SpanContext and as the current Span.
ContextWithSpan returns a copy of parent with span set as the current Span.
ContextWithSpanContext returns a copy of parent with sc as the current Span.
LinkFromContext returns a link encapsulating the SpanContext in the provided ctx.
NewEventConfig applies all the EventOptions to a returned EventConfig.
NewNoopTracerProvider returns an implementation of TracerProvider that performs no operations.
NewSpanContext constructs a SpanContext using values from the provided SpanContextConfig.
NewSpanEndConfig applies all the options to a returned SpanConfig.
NewSpanStartConfig applies all the options to a returned SpanConfig.
NewTracerConfig applies all the options to a returned TracerConfig.
ParseTraceState attempts to decode a TraceState from the passed string.
SpanContextFromContext returns the current Span's SpanContext.
SpanFromContext returns the current Span from ctx.
SpanIDFromHex returns a SpanID from a hex string if it is compliant with the w3c trace-context specification.
TraceIDFromHex returns a TraceID from a hex string if it is compliant with the W3C trace-context specification.
ValidateSpanKind returns a valid span kind value.
WithAttributes adds the attributes related to a span life-cycle event.
WithInstrumentationAttributes sets the instrumentation attributes.
WithInstrumentationVersion sets the instrumentation version.
WithLinks adds links to a Span.
WithNewRoot specifies that the Span should be treated as a root Span.
WithSchemaURL sets the schema URL for the Tracer.
WithSpanKind sets the SpanKind of a Span.
WithStackTrace sets the flag to capture the error with stack trace (e.g.
WithTimestamp sets the time of a Span or Event life-cycle moment (e.g.

# Constants

FlagsSampled is a bitmask with the sampled bit set.
SpanKindClient is a SpanKind for a Span that represents the operation of client making a request to a server.
SpanKindConsumer is a SpanKind for a Span that represents the operation of a consumer receiving a message from a message broker.
SpanKindInternal is a SpanKind for a Span that represents an internal operation within an application.
SpanKindProducer is a SpanKind for a Span that represents the operation of a producer sending a message to a message broker.
SpanKindServer is a SpanKind for a Span that represents the operation of handling a request from a client.
SpanKindUnspecified is an unspecified SpanKind and is not a valid SpanKind.

# Structs

EventConfig is a group of options for an Event.
Link is the relationship between two Spans.
SpanConfig is a group of options for a Span.
SpanContext contains identifying trace information about a Span.
SpanContextConfig contains mutable fields usable for constructing an immutable SpanContext.
TracerConfig is a group of options for a Tracer.
TraceState provides additional vendor-specific trace identification information across different distributed tracing systems.

# Interfaces

EventOption applies span event options to an EventConfig.
Span is the individual component of a trace.
SpanEndEventOption are options that can be used at the end of a span, or with an event.
SpanEndOption applies an option to a SpanConfig.
SpanEventOption are options that can be used with an event or a span.
SpanOption are options that can be used at both the beginning and end of a span.
SpanStartEventOption are options that can be used at the start of a span, or with an event.
SpanStartOption applies an option to a SpanConfig.
Tracer is the creator of Spans.
TracerOption applies an option to a TracerConfig.
TracerProvider provides Tracers that are used by instrumentation code to trace computational workflows.

# Type aliases

SpanID is a unique identity of a span in a trace.
SpanKind is the role a Span plays in a Trace.
TraceFlags contains flags that can be set on a SpanContext.
TraceID is a unique identity of a trace.