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 ¶
AddAttributes adds the given map of string attributes to the span.
func FinishWithError ¶
FinishWithError records error information on the span (if err isn't nil) and ends the span.
func RecordError ¶
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.
Click to show internal directories.
Click to hide internal directories.