Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
// RecordDuration records the duration of an operation.
RecordDuration(operation string, duration time.Duration, labels map[string]string)
// RecordCount records the count of an operation (success/failure).
RecordCount(operation string, status string, labels map[string]string)
// RecordValue records a custom metric value.
RecordValue(metricName string, value float64, labels map[string]string)
}
Collector defines the interface for collecting metrics.
func NewNoopCollector ¶
func NewNoopCollector() Collector
NewNoopCollector creates a no-op collector that discards all metrics.
type Span ¶
type Span interface {
// SetTag sets a tag on the span.
SetTag(key string, value interface{})
// LogEvent logs an event within the span.
LogEvent(eventName string, fields map[string]interface{})
// End ends the span.
End()
}
Span represents a single operation in a trace.
type Tracer ¶
type Tracer interface {
// StartSpan starts a new span/tracing context.
StartSpan(ctx context.Context, operationName string) (context.Context, Span)
// GetSpan retrieves the current span from context.
GetSpan(ctx context.Context) Span
}
Tracer defines the interface for distributed tracing.
Click to show internal directories.
Click to hide internal directories.