Documentation
¶
Overview ¶
Package tracing wraps the OpenTelemetry SDK into a small surface Parsec actually uses: a tracer + a shutdown hook.
Default-off: when no OTLP endpoint is configured, NewTracer returns a no-op tracer. The hot path performs no allocations and no exporter is constructed, so embedders pay nothing for the feature until they opt in.
Index ¶
Constants ¶
const ServiceName = "parsec"
ServiceName is baked into every span resource. Embedders that need a different value should fork this package; we keep it constant so the trace UI always shows the same service name across deployments.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShutdownFunc ¶
ShutdownFunc shuts the tracer provider down, flushing any buffered spans. Safe to call multiple times; no-op tracers return nil.
func NewTracer ¶
func NewTracer(otlpEndpoint string) (trace.Tracer, ShutdownFunc, error)
NewTracer constructs a tracer + shutdown hook.
When otlpEndpoint is "" the returned tracer is a no-op (every span is a zero-allocation stub) and the shutdown returns nil. This is the default-off path.
When otlpEndpoint is set, an OTLP HTTP exporter is configured against that endpoint with insecure transport (the operator is responsible for terminating TLS at the collector or using a sidecar). The endpoint format follows the OTLP HTTP convention — host:port WITHOUT a scheme, or a full URL whose path will be honored.