Documentation
¶
Overview ¶
Package tracing provides OpenTelemetry tracing support for GoCacheX.
Index ¶
- type NoOpTracer
- func (n *NoOpTracer) AddEvent(ctx context.Context, name string, attributes ...trace.EventOption)
- func (n *NoOpTracer) Close() error
- func (n *NoOpTracer) GetServiceName() string
- func (n *NoOpTracer) IsEnabled() bool
- func (n *NoOpTracer) RecordError(ctx context.Context, err error)
- func (n *NoOpTracer) SetAttributes(ctx context.Context, attributes ...trace.SpanStartEventOption)
- func (n *NoOpTracer) SpanFromContext(ctx context.Context) trace.Span
- func (n *NoOpTracer) StartSpan(ctx context.Context, operationName string) (context.Context, trace.Span)
- func (n *NoOpTracer) TraceBatchOperation(ctx context.Context, operation, backend string, keyCount int, ...) error
- func (n *NoOpTracer) TraceOperation(ctx context.Context, operation, backend string, ...) error
- type Tracer
- func (t *Tracer) AddEvent(ctx context.Context, name string, attributes ...trace.EventOption)
- func (t *Tracer) Close() error
- func (t *Tracer) GetServiceName() string
- func (t *Tracer) IsEnabled() bool
- func (t *Tracer) RecordError(ctx context.Context, err error)
- func (t *Tracer) SetAttributes(ctx context.Context, attributes ...trace.SpanStartEventOption)
- func (t *Tracer) SpanFromContext(ctx context.Context) trace.Span
- func (t *Tracer) StartSpan(ctx context.Context, operationName string) (context.Context, trace.Span)
- func (t *Tracer) TraceBatchOperation(ctx context.Context, operation, backend string, keyCount int, ...) error
- func (t *Tracer) TraceOperation(ctx context.Context, operation, backend string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoOpTracer ¶
type NoOpTracer struct{}
NoOpTracer is a no-operation tracer for when tracing is disabled.
func (*NoOpTracer) AddEvent ¶
func (n *NoOpTracer) AddEvent(ctx context.Context, name string, attributes ...trace.EventOption)
AddEvent is a no-op implementation.
func (*NoOpTracer) GetServiceName ¶
func (n *NoOpTracer) GetServiceName() string
GetServiceName returns empty string for no-op tracer.
func (*NoOpTracer) IsEnabled ¶
func (n *NoOpTracer) IsEnabled() bool
IsEnabled returns false for no-op tracer.
func (*NoOpTracer) RecordError ¶
func (n *NoOpTracer) RecordError(ctx context.Context, err error)
RecordError is a no-op implementation.
func (*NoOpTracer) SetAttributes ¶
func (n *NoOpTracer) SetAttributes(ctx context.Context, attributes ...trace.SpanStartEventOption)
SetAttributes is a no-op implementation.
func (*NoOpTracer) SpanFromContext ¶
func (n *NoOpTracer) SpanFromContext(ctx context.Context) trace.Span
SpanFromContext is a no-op implementation.
func (*NoOpTracer) StartSpan ¶
func (n *NoOpTracer) StartSpan(ctx context.Context, operationName string) (context.Context, trace.Span)
StartSpan is a no-op implementation.
func (*NoOpTracer) TraceBatchOperation ¶
func (n *NoOpTracer) TraceBatchOperation(ctx context.Context, operation, backend string, keyCount int, fn func(ctx context.Context) error) error
TraceBatchOperation is a no-op implementation.
func (*NoOpTracer) TraceOperation ¶
func (n *NoOpTracer) TraceOperation(ctx context.Context, operation, backend string, fn func(ctx context.Context) error) error
TraceOperation is a no-op implementation.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer wraps OpenTelemetry tracing functionality.
func (*Tracer) GetServiceName ¶
GetServiceName returns the service name for tracing.
func (*Tracer) RecordError ¶
RecordError records an error on the current span.
func (*Tracer) SetAttributes ¶
func (t *Tracer) SetAttributes(ctx context.Context, attributes ...trace.SpanStartEventOption)
SetAttributes sets attributes on the current span.
func (*Tracer) SpanFromContext ¶
SpanFromContext returns the span from the context.