tracetools

package
v4.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tracetools provides an abstraction across tracing systems (OpenTelemetry, DataDog).

It is intended for internal use by buildkite-agent only.

Index

Constants

View Source
const (
	BackendOpenTelemetry = "opentelemetry"
	BackendNone          = ""
)

Variables

View Source
var ValidTracingBackends = map[string]struct{}{
	BackendOpenTelemetry: {},
	BackendNone:          {},
}

Functions

func AddAttributes

func AddAttributes(span trace.Span, attributes map[string]string)

AddAttributes adds the given map of string attributes to the span.

func FinishWithError

func FinishWithError(span trace.Span, err error)

FinishWithError records error information on the span (if err isn't nil) and ends the span.

func RecordError

func RecordError(span trace.Span, err error)

RecordError records an error on the span. No-op when err is nil.

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, operation, tracingBackend string) (trace.Span, context.Context)

StartSpanFromContext starts a span appropriate to the given tracing backend from the given context with the given operation name. It also does some common/repeated setup on the span to keep code a little more DRY. If an unknown tracing backend is specified, it will return a non-recording span.

Types

This section is empty.

Jump to

Keyboard shortcuts

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