package metrics import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var ( WorkerJobCounter = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "transcriber_worker_job_count", Help: "Count of jobs handled by each worker", }, []string{"name", "error"}, ) // Размер принятых на обработку файлов (в байтах) InputFileSizeHistogram = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "transcriber_input_file_size_bytes", Help: "Size of input files received for processing", Buckets: []float64{1024, 10240, 102400, 1048576, 10485760, 104857600, 1073741824}, // 1KB, 10KB, 100KB, 1MB, 10MB, 100MB, 1GB }, []string{"file_extension"}, ) // Время конвертации файлов (в секундах) InputFileDurationHistogram = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "transcriber_input_file_duration_seconds", Help: "Duration of input audio file", Buckets: []float64{15, 30, 60, 120, 300, 600, 1200, 1800, 2400, 3000, 3600, 7200, 10800, 14400}, }, []string{}, ) // Время конвертации файлов (в секундах) ConversionDurationHistogram = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "transcriber_conversion_duration_seconds", Help: "Time taken to convert audio files", Buckets: []float64{0.1, 0.5, 1, 5, 10, 30, 60, 120, 300}, // 0.1s, 0.5s, 1s, 5s, 10s, 30s, 1m, 2m, 5m }, []string{"source_format", "target_format", "error"}, ) // Размер файла после конвертации (в байтах) OutputFileSizeHistogram = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "transcriber_output_file_size_bytes", Help: "Size of files after conversion", Buckets: []float64{1024, 10240, 102400, 1048576, 10485760, 104857600, 1073741824}, // 1KB, 10KB, 100KB, 1MB, 10MB, 100MB, 1GB }, []string{"format"}, ) )