Documentation
¶
Overview ¶
Package telemetry configures OpenTelemetry tracing from the standard OTEL_* environment, so Hecate drops into an existing collector setup with no Hecate-specific configuration at all.
It is off unless asked for. The OpenTelemetry SDK's own default is to export to localhost:4318, which for the overwhelming majority of installations means a controller logging connection failures forever about a collector nobody deployed. Silence is the better default; one environment variable turns it on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled reports whether the environment asks for tracing.
`OTEL_TRACES_EXPORTER=none` is the specified way to turn it off and wins over everything else; otherwise an endpoint — general or traces-specific — is what says a collector exists.
func NewTraceID ¶
func NewTraceID() string
NewTraceID returns a fresh W3C trace ID as 32 hex characters.
Allocated when a Passage starts rather than when its trace is emitted, because a `traceparent` git trailer has to be written *during* the crossing — long before the trace exists. Persisting it in `status.traceID` also keeps commits reproducible: a retried Passage writes the same trailer, so it produces the same commit SHA (D42).
func Start ¶
func Start(ctx context.Context, service, version string) (shutdown func(context.Context) error, enabled bool, err error)
Start installs the global tracer provider and propagator.
The returned shutdown flushes buffered spans; it is never nil, so callers can defer it unconditionally. When tracing is disabled Start does nothing and reports it, leaving OpenTelemetry's no-op provider in place — every tracer.Start in the codebase then costs an interface call and produces an invalid span context, which is exactly what the callers already handle.
func Traceparent ¶
Traceparent renders a W3C `traceparent` header value for a Passage's trace.
**The parent span ID is the trace ID's own second half.** It therefore needs no field of its own — anyone holding `status.traceID` can recompute the exact trailer that was written — and it names a span Hecate never emits: the promotion commit itself. Git is the rendezvous (D3), so the commit is where the crossing and whatever reconciles it downstream both hang from.
Returns "" for anything that is not a valid trace ID, so a caller can treat "no trace" and "no trailer" as the same case.
Types ¶
This section is empty.