Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tracer ¶
type Tracer interface {
Start(ctx context.Context, name string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
// StartClient begins a span explicitly marked as SpanKindClient to represent
// an outgoing client operation (e.g., LDAP, HTTP client, Redis, etc.).
// Optional attributes can be supplied and will be set on the span.
StartClient(ctx context.Context, name string, attrs ...attribute.KeyValue) (context.Context, trace.Span)
}
Tracer is a narrow facade over OpenTelemetry's trace.Tracer to keep instrumentation usage simple and testable across the codebase.
Usage:
tr := trace.New("nauthilus/ldap")
ctx, sp := tr.Start(ctx, "ldap.search", attribute.String("bucket", bucket))
defer sp.End()
In tests, this interface can be replaced with a lightweight fake if needed.
Click to show internal directories.
Click to hide internal directories.