metrics

package
v0.0.0-...-a36e19c Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Metrics Package

Package metrics provides Prometheus metrics collection for the Whisper API service.

Available Metrics

Counters
  • whisperapi_transcription_requests_total{status="success|error",format="wav|mp3|ogg|opus"}
    • Total number of transcription requests by status and format
Histograms
  • whisperapi_transcription_duration_seconds
    • Time taken to process transcription requests
  • whisperapi_audio_duration_seconds
    • Duration of processed audio files
  • whisperapi_cpu_time_seconds{operation="user|system|total"}
    • CPU time spent processing requests
Gauges
  • whisperapi_memory_usage_bytes{type="allocated|system|heap"}
    • Memory usage statistics

Usage Example

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TranscriptionRequests = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "whisperapi_transcription_requests_total",
		Help: "Total number of transcription requests",
	}, []string{"status", "format"})

	TranscriptionDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "whisperapi_transcription_duration_seconds",
		Help:    "Time spent processing transcription requests",
		Buckets: prometheus.ExponentialBuckets(0.1, 2.0, 10),
	}, []string{"format"})

	AudioDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "whisperapi_audio_duration_seconds",
		Help:    "Duration of processed audio files",
		Buckets: prometheus.ExponentialBuckets(1, 2.0, 10),
	}, []string{"format"})

	MemoryUsage = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: "whisperapi_memory_usage_bytes",
		Help: "Memory usage during transcription",
	}, []string{"type"})

	CPUTime = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "whisperapi_cpu_time_seconds",
		Help:    "CPU time spent on transcription",
		Buckets: prometheus.ExponentialBuckets(0.1, 2.0, 10),
	}, []string{"operation"})

	GPUTime = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "whisperapi_gpu_time_seconds",
		Help:    "GPU time spent on transcription (if available)",
		Buckets: prometheus.ExponentialBuckets(0.1, 2.0, 10),
	}, []string{"operation"})
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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