Skip to content

Commit

Permalink
Add histogram buckets to function and RBL duration metrics
Browse files Browse the repository at this point in the history
This commit enhances the monitoring by introducing exponential buckets for the "function_duration_seconds" and "rbl_duration_seconds" histograms. The new buckets will allow for improved granularity and analysis of duration metrics.

Signed-off-by: Christian Roessner <[email protected]>
  • Loading branch information
Christian Roessner committed Nov 7, 2024
1 parent 43c904d commit 391013d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server/stats/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,16 @@ var (

// FunctionDuration variable declaration that creates a new Prometheus SummaryVec with the specified name and help message, and with "service" and "method" labels.
FunctionDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "function_duration_seconds",
Help: "Time spent in function",
Name: "function_duration_seconds",
Help: "Time spent in function",
Buckets: prometheus.ExponentialBuckets(0.001, 1.75, 15),
}, []string{"service", "task"})

// RBLDuration tracks the duration of DNS RBL (Real-time Blackhole List) lookups.
RBLDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "rbl_duration_seconds",
Help: "Time spent for RBL lookups",
Name: "rbl_duration_seconds",
Help: "Time spent for RBL lookups",
Buckets: prometheus.ExponentialBuckets(0.001, 1.75, 15),
}, []string{"rbl"})

// CacheHits variable declaration that creates a new Prometheus Counter with the specified name and help message, which counts the total number of cache hits.
Expand Down

0 comments on commit 391013d

Please sign in to comment.