Skip to main content
Requirements: Go ≥ 1.21

Installation


Quick start

1

Initialise the SDK

main.go
2

Or use environment variables (zero code changes)


Configuration reference

Custom resource attributes


Tracing

Automatic instrumentation

Once tracelit.New (or tracelit.Configure) is called, the global OTel TracerProvider is set. Any library that uses the OTel API (otelhttp, otelgrpc, otelsql, etc.) will automatically send spans to Tracelit without further configuration.

Manual spans

Span kinds

Stack traces on errors

RecordError captures a full goroutine stack trace automatically:

Panic recovery

Trace and span IDs (for log correlation)

Passing spans across goroutines


HTTP and gRPC instrumentation

HTTP server and client

gRPC


Metrics

Runtime and process metrics (goroutines, GC, memory) are exported automatically every 60 seconds — no extra code required.

Logger bridges

All bridges route log records to the Tracelit log pipeline and automatically inject trace_id and span_id from the context.

slog (standard library)


Sampling and error guarantee

Error spans are always exported, even when the parent trace falls outside the sample ratio. The SDK uses a custom ErrorAlwaysOnSampler + ErrorSpanProcessor pair — no configuration required.

Disabling in tests


Complete example


GitHub

Source code and issue tracker: github.com/Tracelit-AI/tracelit-go