Documentation ¶
Overview ¶
Package span defines the interface for tracing spans used in various packages.
Index ¶
Constants ¶
View Source
const ( SpanKindServer = "server" SpanKindClient = "client" SpanKindConsumer = "consumer" SpanKindProducer = "producer" SpanKindInternal = "internal" )
Constants representing different kinds of spans.
View Source
const (
HTTPStatusCode = "http.response.status_code"
)
Constants representing attribute keys for spans.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Span ¶
type Span interface { SetAttribute(key string, value any) SetStatus(statusCode int, description string) SetError(err error, stackTrace string) Finish() }
Span represents a tracing span with methods to set attributes, status, errors, and to finish the span.
type SpanOp ¶
type SpanOp interface { NewSpanFromContext(ctx context.Context, operationName string, kind string, resourceName string) (context.Context, Span) GetSpanFromContext(ctx context.Context) (Span, bool) }
SpanOp represents operations that can be performed with spans, including creating new spans and retrieving existing spans from context.
Click to show internal directories.
Click to hide internal directories.