span

package
v6.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL