Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jun 22, 2026 Changes in this version + func InitTracer(ctx context.Context, serviceName string) (shutdown func(context.Context) error, err error) + func Tracer() trace.Tracer + type Counter struct + func NewCounter(name string, labels map[string]string) *Counter + func (c *Counter) Add(delta uint64) + func (c *Counter) Inc() + func (c *Counter) Reset() + func (c *Counter) ToMetric() Metric + func (c *Counter) Value() uint64 + type Gauge struct + func NewGauge(name string, labels map[string]string) *Gauge + func (g *Gauge) Add(delta float64) + func (g *Gauge) Set(value float64) + func (g *Gauge) ToMetric() Metric + func (g *Gauge) Value() float64 + type Histogram struct + func NewHistogram(name string, labels map[string]string, buckets []float64) *Histogram + func (h *Histogram) Average() float64 + func (h *Histogram) Count() uint64 + func (h *Histogram) Observe(value float64) + func (h *Histogram) Percentile(percentile float64) float64 + func (h *Histogram) Reset() + func (h *Histogram) Sum() float64 + func (h *Histogram) ToMetric() Metric + type LogLevel string + const LogLevelDebug + const LogLevelError + const LogLevelFatal + const LogLevelInfo + const LogLevelWarn + type Logger struct + func NewLogger() *Logger + func NewLoggerWithConfig(config *LoggerConfig) *Logger + func (l *Logger) Debug(msg string, fields map[string]interface{}) + func (l *Logger) DebugWithContext(ctx context.Context, msg string, fields map[string]interface{}) + func (l *Logger) Error(msg string, fields map[string]interface{}) + func (l *Logger) ErrorWithContext(ctx context.Context, msg string, fields map[string]interface{}) + func (l *Logger) ErrorWithStack(msg string, err error, fields map[string]interface{}) + func (l *Logger) Fatal(msg string, fields map[string]interface{}) + func (l *Logger) FatalWithContext(ctx context.Context, msg string, fields map[string]interface{}) + func (l *Logger) Info(msg string, fields map[string]interface{}) + func (l *Logger) InfoWithContext(ctx context.Context, msg string, fields map[string]interface{}) + func (l *Logger) LogCircuitBreakerState(ctx context.Context, from, to string, reason string) + func (l *Logger) LogError(ctx context.Context, err error, operation string) + func (l *Logger) LogRequest(ctx context.Context, method, url string, statusCode int, ...) + func (l *Logger) LogToolExecution(ctx context.Context, toolName string, duration time.Duration, success bool) + func (l *Logger) SetContext(ctx context.Context) map[string]string + func (l *Logger) SetLevel(level LogLevel) + func (l *Logger) Warn(msg string, fields map[string]interface{}) + func (l *Logger) WarnWithContext(ctx context.Context, msg string, fields map[string]interface{}) + type LoggerConfig struct + ContextFields []string + FilePath string + Format string + Level LogLevel + Output string + func DefaultLoggerConfig() *LoggerConfig + type Metric struct + Labels map[string]string + Name string + Timestamp time.Time + Type MetricType + Value float64 + type MetricType string + const MetricTypeCounter + const MetricTypeGauge + const MetricTypeHistogram + const MetricTypeTimer + type RequestLogger struct + func NewRequestLogger(logger *Logger) *RequestLogger + func (rl *RequestLogger) LogRequest(ctx context.Context, req interface{}, resp interface{}, err error, ...) + type System struct + func NewSystem(logger *Logger) *System + func (m *System) Close() error + func (m *System) GetAllMetrics() map[string]interface{} + func (m *System) GetLogger() *Logger + func (m *System) GetMetricsSnapshot(format string) (string, error) + func (m *System) RecordAPIFailure(err error, duration time.Duration) + func (m *System) RecordAPIRateLimit() + func (m *System) RecordAPIRequest() + func (m *System) RecordAPISuccess(duration time.Duration) + func (m *System) RecordCacheStats(readTokens, creationTokens int) + func (m *System) RecordCircuitBreakerStateTransition(from, to string, reason string) + func (m *System) RecordCircuitBreakerTrip(provider string) + func (m *System) RecordError(err error, context string) + func (m *System) RecordQueryFailure(err error, duration time.Duration) + func (m *System) RecordQueryIteration() + func (m *System) RecordQuerySuccess(duration time.Duration) + func (m *System) RecordQueryTurn() + func (m *System) RecordToolCall(toolName string) + func (m *System) RecordToolFailure(toolName string, err error, duration time.Duration) + func (m *System) RecordToolPermissionDenial(toolName string) + func (m *System) RecordToolSuccess(toolName string, duration time.Duration) + func (m *System) ResetAllMetrics() + func (m *System) SetCircuitBreakerState(state string) + func (m *System) SetLogger(logger *Logger) + func (m *System) UpdateActiveConnections(count float64) + func (m *System) UpdateActiveSessions(count float64) + func (m *System) UpdateMemoryUsage(mb float64) + type Timer struct + func NewTimer(name string, labels map[string]string) *Timer + func (t *Timer) Average() float64 + func (t *Timer) Count() uint64 + func (t *Timer) Percentile(percentile float64) time.Duration + func (t *Timer) Record(duration time.Duration) + func (t *Timer) Reset() + func (t *Timer) Start() func() + func (t *Timer) ToMetric() Metric