diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-07-15 19:25:43 +0300 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-07-19 18:32:12 +0300 |
| commit | 8f58905364915fce4929649afe4835358d9d831b (patch) | |
| tree | a3f4132014bf38600d533f97b99db3e305a5e515 /internal/server/metrics | |
| parent | afee78d6256264d8b1fb556218be1a5434f7a295 (diff) | |
Added in progress requests metric and also returning an error when the
user hits the rate limit
Diffstat (limited to 'internal/server/metrics')
| -rw-r--r-- | internal/server/metrics/metrics.go | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/internal/server/metrics/metrics.go b/internal/server/metrics/metrics.go index 5f7eb15..4937787 100644 --- a/internal/server/metrics/metrics.go +++ b/internal/server/metrics/metrics.go @@ -13,11 +13,11 @@ var RequestsProcessed = promauto.NewCounterVec(prometheus.CounterOpts{ Help: "The total number of processed requests", }, []string{"request_type", "dropped"}) -// var RequestsInProgress = promauto.NewCounterVec(prometheus.CounterOpts{ -// Namespace: namespace, -// Name: "requests_in_progress_total", -// Help: "The total number of in-progress requests", -// }, []string{"request_type"}) +var RequestsInProgress = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "requests_in_progress_total", + Help: "The total number of in-progress requests", +}, []string{"request_type"}) var RequestProcessingDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Namespace: namespace, @@ -26,20 +26,6 @@ var RequestProcessingDuration = promauto.NewHistogramVec(prometheus.HistogramOpt NativeHistogramBucketFactor: 1.00271, }, []string{"request_type", "dropped"}) -// var RequestProcessingDuration = promauto.NewSummaryVec(prometheus.SummaryOpts{ -// Namespace: namespace, -// Name: "request_processing_duration_seconds", -// Help: "The duration in seconds it took to process a request", -// Objectives: map[float64]float64{ -// 0.01: 0.001, -// 0.50: 0.005, -// 0.90: 0.009, -// 0.95: 0.0095, -// 0.99: 0.0099, -// }, -// MaxAge: 1 * time.Hour, -// }, []string{"request_type"}) - var ConnectionsEstablished = promauto.NewCounter(prometheus.CounterOpts{ Namespace: namespace, Name: "connections_established_total", |
