Documentation
¶
Index ¶
Constants ¶
const RedactedAttributeValue = "<redacted>"
RedactedAttributeValue is the placeholder substituted for sensitive span-attribute values before export. Mirrors the slogging convention.
Variables ¶
This section is empty.
Functions ¶
func RegisterPoolMetrics ¶
func RegisterPoolMetrics(dbStatsFn func() DBPoolStats, redisStatsFn func() RedisPoolStats) error
RegisterPoolMetrics registers observable gauges for DB and Redis pool monitoring. Either dbStatsFn or redisStatsFn may be nil to skip registration for that pool.
Types ¶
type DBPoolStats ¶
type DBPoolStats struct {
OpenConnections int
Idle int
InUse int
WaitCount int64
WaitDuration time.Duration
}
DBPoolStats holds snapshot statistics for a database connection pool.
type RedactingSpanExporter ¶
type RedactingSpanExporter struct {
// contains filtered or unexported fields
}
RedactingSpanExporter wraps an sdktrace.SpanExporter so that span attributes matching the sensitive-key catalog are replaced with "<redacted>" before they reach the OTLP collector. This is the defense-in-depth fix for T23 — even if a future instrumentation path sets `attribute.String("authorization", header)` directly, the value never leaves the process.
func NewRedactingSpanExporter ¶
func NewRedactingSpanExporter(inner sdktrace.SpanExporter) *RedactingSpanExporter
NewRedactingSpanExporter wraps the given exporter with attribute redaction. Returns inner verbatim if it is nil.
func (*RedactingSpanExporter) ExportSpans ¶
func (r *RedactingSpanExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
ExportSpans redacts sensitive attribute values before forwarding to the wrapped exporter.
type RedisPoolStats ¶
RedisPoolStats holds snapshot statistics for a Redis connection pool.
type TMIMetrics ¶
type TMIMetrics struct {
CacheHits metric.Int64Counter
CacheMisses metric.Int64Counter
WebSocketActiveSessions metric.Int64UpDownCounter
WebSocketActiveParticipants metric.Int64UpDownCounter
WebSocketMessages metric.Int64Counter
WebhookDeliveries metric.Int64Counter
WebhookResponseTooLarge metric.Int64Counter
WebhookResponseHeaderTO metric.Int64Counter
WebhookCircuitOpen metric.Int64Counter
TimmyActiveSessions metric.Int64UpDownCounter
TimmyLLMDuration metric.Float64Histogram
TimmyLLMTokens metric.Int64Counter
TimmyEmbedDuration metric.Float64Histogram
TimmySSEDuration metric.Float64Histogram
TimmySSEEvents metric.Int64Counter
MarkdownGateTooComplex metric.Int64Counter
}
TMIMetrics holds all custom OTel metric instruments for TMI.
var GlobalMetrics *TMIMetrics
GlobalMetrics holds the TMI metrics instance for package-level access.
func NewTMIMetrics ¶
func NewTMIMetrics() (*TMIMetrics, error)
NewTMIMetrics creates and registers all TMI metric instruments.