telemetry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package telemetry configures OpenTelemetry tracing for dfetch. Tracing is off by default: instrumentation creates spans against the global no-op TracerProvider and costs almost nothing until Setup installs a real provider, which only happens when an OTLP endpoint is configured via the environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether OTLP tracing is configured via the environment. Tracing turns on only when an OTLP endpoint is set (and not explicitly disabled), so running dfetch without those vars emits no traces.

func Setup

func Setup(ctx context.Context, serviceVersion string) (shutdown func(context.Context) error, err error)

Setup installs a global TracerProvider exporting over OTLP/HTTP when tracing is Enabled, and returns a shutdown func that flushes pending spans. When tracing is not enabled it installs nothing and returns a no-op shutdown.

func Tracer

func Tracer() trace.Tracer

Tracer returns dfetch's tracer. It is a no-op tracer unless Setup installed a provider, so callers can start spans unconditionally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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