
tracing
Index
- Variables
- func DurationAttr(name string, seconds float64) attribute.KeyValue
- func ErrorAttr(err error) attribute.KeyValue
- func Init(ctx context.Context, mode, endpoint string) (func(context.Context) error, error)
- func InstanceAttr(id string) attribute.KeyValue
- func NodeAttr(name string) attribute.KeyValue
- func PeerServiceAttr(name string) attribute.KeyValue
- func ServerAddressAttr(addr string) attribute.KeyValue
- func StartClientSpan(ctx context.Context, name string, attrs …attribute.KeyValue) (context.Context, trace.Span)
- func StartSpan(ctx context.Context, name string, attrs …attribute.KeyValue) (context.Context, trace.Span)
- func StateAttr(state string) attribute.KeyValue
- func StatusAttr(status string) attribute.KeyValue
- func Tracer() trace.Tracer
Variables
Version of the service for trace metadata. Set at build time via -ldflags “-X github.com/afreidah/oracle-watchdog/internal/tracing.Version=…”
func DurationAttr
DurationAttr creates a duration attribute in seconds.
func ErrorAttr
ErrorAttr creates an error attribute.
func Init
Init initializes the OpenTelemetry tracer with the OTLP/HTTP exporter and returns a shutdown function that should be deferred. The endpoint resolves in precedence order: the endpoint argument (from config), then the OTEL_EXPORTER_OTLP_ENDPOINT env var, then defaultOTLPEndpoint. All forms are a bare host:port with no scheme.
func InstanceAttr
InstanceAttr creates an instance ID attribute.
func NodeAttr
NodeAttr creates a node name attribute.
func PeerServiceAttr
PeerServiceAttr creates a peer.service attribute for service graph edges.
func ServerAddressAttr
ServerAddressAttr creates a server.address attribute.
func StartClientSpan
StartClientSpan creates a span with SpanKindClient for outbound service calls. Client spans are required for Tempo’s service graph to detect service-to-service edges.
func StartSpan
StartSpan starts a new span with the given name and returns context + span.
func StateAttr
StateAttr creates a lifecycle state attribute.
func StatusAttr
StatusAttr creates a status attribute (alive, missing, restarting).
func Tracer
Tracer returns the global tracer instance.
Generated by gomarkdoc