Documentation
¶
Overview ¶
Package tracing wires up an OpenTelemetry tracer provider configured by the standard OTEL_EXPORTER_OTLP_ENDPOINT environment variable. When no exporter is configured the provider is a no-op, so instrumented code pays a single indirect-call cost and emits nothing. The intent is that Fleetsweeper's scan code can sprinkle spans freely without forcing every deployment to run a collector.
Index ¶
Constants ¶
const TracerName = "github.com/dcadolph/fleetsweeper"
TracerName is the instrumentation library name used for spans emitted from Fleetsweeper packages. Backends and dashboards key off this string.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init bootstraps OpenTelemetry tracer and meter providers for the process. It returns a shutdown function that the caller must invoke before exit so pending spans and metric points are flushed.
Behavior:
- If OTEL_EXPORTER_OTLP_ENDPOINT (or the trace-specific variant) is unset, the trace provider is the no-op SDK default.
- If OTEL_EXPORTER_OTLP_ENDPOINT (or the metrics-specific variant) is unset, the meter provider is the no-op SDK default.
- When either endpoint is set, an OTLP-HTTP exporter is installed for the corresponding signal with the appropriate processor.
- The W3C TraceContext propagator is installed unconditionally so downstream callers can already participate in distributed traces.
Version is the service version emitted as a resource attribute.
Types ¶
This section is empty.