Made the buckets sizes for Histograms measuring seconds into more "human" timspans (minutes, hours, days)

This commit is contained in:
Per Abich 2020-02-28 15:05:52 +01:00
parent b0b31e3bab
commit 9cfeea8536

View File

@ -458,6 +458,7 @@ func NewPostfixExporter(showqPath string, logfilePath string, journal *Journal,
return nil, err
}
}
timeBuckets := []float64{1e-3, 1e-2, 1e-1, 1.0, 10, 1 * 60, 1 * 60 * 60, 24 * 60 * 60, 2 * 24 * 60 * 60}
return &PostfixExporter{
logUnsupportedLines: logUnsupportedLines,
showqPath: showqPath,
@ -484,7 +485,7 @@ func NewPostfixExporter(showqPath string, logfilePath string, journal *Journal,
Namespace: "postfix",
Name: "lmtp_delivery_delay_seconds",
Help: "LMTP message processing time in seconds.",
Buckets: []float64{1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3},
Buckets: timeBuckets,
},
[]string{"stage"}),
pipeDelays: prometheus.NewHistogramVec(
@ -492,7 +493,7 @@ func NewPostfixExporter(showqPath string, logfilePath string, journal *Journal,
Namespace: "postfix",
Name: "pipe_delivery_delay_seconds",
Help: "Pipe message processing time in seconds.",
Buckets: []float64{1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3},
Buckets: timeBuckets,
},
[]string{"relay", "stage"}),
qmgrInsertsNrcpt: prometheus.NewHistogram(prometheus.HistogramOpts{
@ -517,7 +518,7 @@ func NewPostfixExporter(showqPath string, logfilePath string, journal *Journal,
Namespace: "postfix",
Name: "smtp_delivery_delay_seconds",
Help: "SMTP message processing time in seconds.",
Buckets: []float64{1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3},
Buckets: timeBuckets,
},
[]string{"stage"}),
smtpTLSConnects: prometheus.NewCounterVec(