tracing

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 9 Imported by: 0

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

View Source
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

type ShutdownFunc func(context.Context) error

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.

Jump to

Keyboard shortcuts

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