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