telemetry

package
v0.0.0-...-5ed4770 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package telemetry provides Prometheus metrics and OpenTelemetry tracing infrastructure for the Sequify server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	// HTTP
	HTTPRequestDuration *prometheus.HistogramVec
	HTTPRequestsTotal   *prometheus.CounterVec

	// WebSocket
	WSActiveConnections prometheus.Gauge
	WSConnectionsTotal  *prometheus.CounterVec
	WSMessagesTotal     *prometheus.CounterVec

	// Agent
	AgentIntentTotal    *prometheus.CounterVec
	AgentIntentDuration *prometheus.HistogramVec
	AgentActiveIntents  prometheus.Gauge

	// LLM
	LLMRequestDuration *prometheus.HistogramVec
	LLMTokensTotal     *prometheus.CounterVec
	LLMErrorsTotal     *prometheus.CounterVec

	// Tool
	ToolExecutionDuration *prometheus.HistogramVec
	ToolExecutionTotal    *prometheus.CounterVec

	// Queue
	QueueDepth      *prometheus.GaugeVec
	QueueTasksTotal *prometheus.CounterVec
}

Metrics holds all application metrics registered to a custom registry.

func NewMetrics

func NewMetrics(reg prometheus.Registerer) *Metrics

NewMetrics creates and registers all 15 application metrics to the given registry. Uses promauto.With(reg) for testable registration with a custom registry.

type Telemetry

type Telemetry struct {
	Registry       *prometheus.Registry
	Metrics        *Metrics
	TracerProvider *sdktrace.TracerProvider
}

Telemetry combines Prometheus metrics and OpenTelemetry tracing.

func New

New creates a Telemetry instance with Prometheus registry and OTel TracerProvider. Returns the Telemetry instance; call Shutdown to flush traces on exit.

func (*Telemetry) Shutdown

func (t *Telemetry) Shutdown(ctx context.Context) error

Shutdown flushes any pending traces and shuts down the TracerProvider.

Jump to

Keyboard shortcuts

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