observability

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedTracer

type DistributedTracer struct {
	// contains filtered or unexported fields
}

func NewDistributedTracer

func NewDistributedTracer() *DistributedTracer

func (*DistributedTracer) AddAttribute

func (t *DistributedTracer) AddAttribute(span *TraceSpan, key, value string)

func (*DistributedTracer) EndSpan

func (t *DistributedTracer) EndSpan(span *TraceSpan, status string)

func (*DistributedTracer) GetSpans

func (t *DistributedTracer) GetSpans() []*TraceSpan

func (*DistributedTracer) StartSpan

func (t *DistributedTracer) StartSpan(id, name string, parentID string) *TraceSpan

type LogEntry

type LogEntry struct {
	Timestamp     time.Time              `json:"timestamp"`
	Level         LogLevel               `json:"level"`
	Message       string                 `json:"message"`
	CorrelationID string                 `json:"correlation_id,omitempty"`
	Fields        map[string]interface{} `json:"fields,omitempty"`
}

type LogLevel

type LogLevel string
const (
	LogDebug LogLevel = "DEBUG"
	LogInfo  LogLevel = "INFO"
	LogWarn  LogLevel = "WARN"
	LogError LogLevel = "ERROR"
)

type MetricCollector

type MetricCollector struct {
	// contains filtered or unexported fields
}

func NewMetricCollector

func NewMetricCollector() *MetricCollector

func (*MetricCollector) ExportPrometheus

func (m *MetricCollector) ExportPrometheus() string

func (*MetricCollector) GetCounter

func (m *MetricCollector) GetCounter(name string) int64

func (*MetricCollector) GetGauge

func (m *MetricCollector) GetGauge(name string) float64

func (*MetricCollector) Inc

func (m *MetricCollector) Inc(name string, value int64)

func (*MetricCollector) Observe

func (m *MetricCollector) Observe(name string, value float64)

func (*MetricCollector) Set

func (m *MetricCollector) Set(name string, value float64)

type SLAReporter

type SLAReporter struct {
	// contains filtered or unexported fields
}

func NewSLAReporter

func NewSLAReporter(targetUptime float64, targetLatency time.Duration) *SLAReporter

func (*SLAReporter) IsHealthy

func (s *SLAReporter) IsHealthy() bool

func (*SLAReporter) Report

func (s *SLAReporter) Report() map[string]interface{}

func (*SLAReporter) Update

func (s *SLAReporter) Update(uptime float64, latency time.Duration)

type StructuredLogger

type StructuredLogger struct {
	// contains filtered or unexported fields
}

func NewStructuredLogger

func NewStructuredLogger() *StructuredLogger

func (*StructuredLogger) Debug

func (l *StructuredLogger) Debug(msg string, fields map[string]interface{})

func (*StructuredLogger) Error

func (l *StructuredLogger) Error(msg string, fields map[string]interface{})

func (*StructuredLogger) Format

func (l *StructuredLogger) Format(entry LogEntry) string

func (*StructuredLogger) GetEntries

func (l *StructuredLogger) GetEntries() []LogEntry

func (*StructuredLogger) Info

func (l *StructuredLogger) Info(msg string, fields map[string]interface{})

func (*StructuredLogger) Warn

func (l *StructuredLogger) Warn(msg string, fields map[string]interface{})

type TraceSpan

type TraceSpan struct {
	ID         string            `json:"id"`
	ParentID   string            `json:"parent_id,omitempty"`
	Name       string            `json:"name"`
	StartTime  time.Time         `json:"start_time"`
	EndTime    time.Time         `json:"end_time"`
	Duration   time.Duration     `json:"duration"`
	Status     string            `json:"status"`
	Attributes map[string]string `json:"attributes,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL