-
Notifications
You must be signed in to change notification settings - Fork 351
/
stats.go
30 lines (25 loc) · 1.01 KB
/
stats.go
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
package dynamodb
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
const (
dynamoRequestDurationStart = 0.001
dynamoRequestDurationFactor = 4
dynamoRequestDurationCount = 9 // use 9 buckets from 1ms to just over 1 minute (65s).
)
var (
dynamoRequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "dynamo_request_duration_seconds",
Help: "Time spent doing DynamoDB requests.",
Buckets: prometheus.ExponentialBuckets(dynamoRequestDurationStart, dynamoRequestDurationFactor, dynamoRequestDurationCount),
}, []string{"operation"})
dynamoConsumedCapacity = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "dynamo_consumed_capacity_total",
Help: "The capacity units consumed by operation.",
}, []string{"operation"})
dynamoFailures = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "dynamo_failures_total",
Help: "The total number of errors while working for kv store.",
}, []string{"operation"})
)