Skip to content

Commit e557aca

Browse files
kakkoyunAleksey Sin
authored and
Aleksey Sin
committed
Re-adjust histogram buckets (thanos-io#1769)
Signed-off-by: Kemal Akkoyun <[email protected]> Signed-off-by: Aleksey Sin <[email protected]>
1 parent 6136c31 commit e557aca

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

cmd/thanos/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func registerQuery(m map[string]setupFunc, app *kingpin.Application) {
168168
func storeClientGRPCOpts(logger log.Logger, reg *prometheus.Registry, tracer opentracing.Tracer, secure bool, cert, key, caCert, serverName string) ([]grpc.DialOption, error) {
169169
grpcMets := grpc_prometheus.NewClientMetrics()
170170
grpcMets.EnableClientHandlingTimeHistogram(
171-
grpc_prometheus.WithHistogramBuckets(prometheus.ExponentialBuckets(0.001, 2, 15)),
171+
grpc_prometheus.WithHistogramBuckets([]float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}),
172172
)
173173
dialOpts := []grpc.DialOption{
174174
// We want to make sure that we can receive huge gRPC messages from storeAPI.

pkg/compact/compact.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func newSyncerMetrics(reg prometheus.Registerer) *syncerMetrics {
8383
m.syncMetaDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
8484
Name: "thanos_compact_sync_meta_duration_seconds",
8585
Help: "Time it took to sync meta files.",
86-
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15),
86+
Buckets: []float64{0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120, 240, 360, 720},
8787
})
8888

8989
m.garbageCollectedBlocks = prometheus.NewCounter(prometheus.CounterOpts{
@@ -101,7 +101,7 @@ func newSyncerMetrics(reg prometheus.Registerer) *syncerMetrics {
101101
m.garbageCollectionDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
102102
Name: "thanos_compact_garbage_collection_duration_seconds",
103103
Help: "Time it took to perform garbage collection iteration.",
104-
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15),
104+
Buckets: []float64{0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120, 240, 360, 720},
105105
})
106106

107107
m.compactions = prometheus.NewCounterVec(prometheus.CounterOpts{

pkg/extprom/http/instrument_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func NewInstrumentationMiddleware(reg prometheus.Registerer) InstrumentationMidd
4141
prometheus.HistogramOpts{
4242
Name: "http_request_duration_seconds",
4343
Help: "Tracks the latencies for HTTP requests.",
44-
Buckets: prometheus.ExponentialBuckets(0.001, 2, 17),
44+
Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120},
4545
},
4646
[]string{"code", "handler", "method"},
4747
),

pkg/objstore/objstore.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func BucketWithMetrics(name string, b Bucket, r prometheus.Registerer) Bucket {
204204
Name: "thanos_objstore_bucket_operation_duration_seconds",
205205
Help: "Duration of operations against the bucket",
206206
ConstLabels: prometheus.Labels{"bucket": name},
207-
Buckets: prometheus.ExponentialBuckets(0.001, 2, 17),
207+
Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120},
208208
}, []string{"operation"}),
209209
lastSuccessfullUploadTime: prometheus.NewGaugeVec(prometheus.GaugeOpts{
210210
Name: "thanos_objstore_bucket_last_successful_upload_time",

pkg/server/grpc/grpc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func New(logger log.Logger, reg prometheus.Registerer, tracer opentracing.Tracer
4343

4444
met := grpc_prometheus.NewServerMetrics()
4545
met.EnableHandlingTimeHistogram(
46-
grpc_prometheus.WithHistogramBuckets(prometheus.ExponentialBuckets(0.001, 2, 15)),
46+
grpc_prometheus.WithHistogramBuckets([]float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}),
4747
)
4848
panicsTotal := prometheus.NewCounter(prometheus.CounterOpts{
4949
Name: "thanos_grpc_req_panics_recovered_total",

pkg/store/bucket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics {
137137
m.seriesGetAllDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
138138
Name: "thanos_bucket_store_series_get_all_duration_seconds",
139139
Help: "Time it takes until all per-block prepares and preloads for a query are finished.",
140-
Buckets: prometheus.ExponentialBuckets(0.01, 2, 15),
140+
Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120},
141141
})
142142
m.seriesMergeDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
143143
Name: "thanos_bucket_store_series_merge_duration_seconds",
144144
Help: "Time it takes to merge sub-results from all queried blocks into a single result.",
145-
Buckets: prometheus.ExponentialBuckets(0.01, 2, 15),
145+
Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120},
146146
})
147147
m.resultSeriesCount = prometheus.NewSummary(prometheus.SummaryOpts{
148148
Name: "thanos_bucket_store_series_result_series",

pkg/store/gate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func NewGate(maxConcurrent int, reg prometheus.Registerer) *Gate {
2626
gateTiming: prometheus.NewHistogram(prometheus.HistogramOpts{
2727
Name: "gate_duration_seconds",
2828
Help: "How many seconds it took for queries to wait at the gate.",
29-
Buckets: prometheus.ExponentialBuckets(0.1, 2, 15),
29+
Buckets: []float64{0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120, 240, 360, 720},
3030
}),
3131
}
3232

0 commit comments

Comments
 (0)