1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
const namespace = "eko"
var RequestsProcessed = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: namespace,
Name: "requests_processed_total",
Help: "The total number of processed requests",
}, []string{"request_type", "dropped"})
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,
Name: "request_processing_duration_seconds",
Help: "The duration in seconds it took to process a request",
NativeHistogramBucketFactor: 1.00271,
}, []string{"request_type", "dropped"})
var ConnectionsEstablished = promauto.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "connections_established_total",
Help: "The total number of established connections",
})
var ConnectionsClosed = promauto.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "connections_closed_total",
Help: "The total number of closed connections",
})
var ConnectionsActive = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: "connections_active_total",
Help: "The total number of active connections",
})
var UsersActive = promauto.NewGauge(prometheus.GaugeOpts{
Namespace: namespace,
Name: "users_active_total",
Help: "The total number of active users",
})
|