Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing initialization for squad.
When an OTLP endpoint is configured (via --otel-endpoint flag or the OTEL_EXPORTER_OTLP_ENDPOINT env var), traces are exported over OTLP/HTTP. When no endpoint is set, a no-op tracer is used and there is zero overhead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(ctx context.Context, serviceName, endpoint string) (shutdown func(context.Context) error, err error)
Init initializes the OpenTelemetry tracer provider with an OTLP HTTP exporter. If endpoint is empty, it falls back to the OTEL_EXPORTER_OTLP_ENDPOINT env var (handled by the SDK). If neither is set, a no-op provider is installed.
The returned shutdown function flushes pending spans and must be called before the process exits.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.