telemetry

package
v0.47.8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package telemetry provides OpenTelemetry tracing for bosun. When BOSUN_OTEL_ENDPOINT is configured, spans are exported via OTLP HTTP. When unconfigured, a noop provider is used (zero overhead).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolAttr

func BoolAttr(key string, value bool) attribute.KeyValue

BoolAttr is a convenience wrapper for attribute.Bool.

func Init

func Init(ctx context.Context, serviceName, serviceVersion, endpoint string) (func(context.Context) error, error)

Init initializes the OTel tracer provider with an OTLP HTTP exporter. If endpoint is empty, installs a noop provider (zero overhead). Returns a shutdown function that flushes pending spans.

func IntAttr

func IntAttr(key string, value int) attribute.KeyValue

IntAttr is a convenience wrapper for attribute.Int.

func SpanError

func SpanError(span trace.Span, err error)

SpanError records an error on a span and sets its status to Error. No-op if err is nil.

func SpanOK

func SpanOK(span trace.Span)

SpanOK sets a span's status to OK.

func StringAttr

func StringAttr(key, value string) attribute.KeyValue

StringAttr is a convenience wrapper for attribute.String.

func Tracer

func Tracer(name string) trace.Tracer

Tracer returns a named tracer for creating spans. Safe to call before Init — returns a noop tracer if uninitialized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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