Fixed formatting.

This commit is contained in:
Bart Vercoulen 2019-02-15 10:41:53 +01:00
parent f51b1f882d
commit d73bd20065
No known key found for this signature in database
GPG Key ID: E6D9CA10D6B6AC2B

View File

@ -238,11 +238,11 @@ func CollectBinaryShowqFromReader(file io.Reader, ch chan<- prometheus.Metric) e
sizeHistogram.WithLabelValues(queue).Observe(size) sizeHistogram.WithLabelValues(queue).Observe(size)
} else if key == "time" { } else if key == "time" {
// Message time as a UNIX timestamp. // Message time as a UNIX timestamp.
time, err := strconv.ParseFloat(value, 64) utime, err := strconv.ParseFloat(value, 64)
if err != nil { if err != nil {
return err return err
} }
ageHistogram.WithLabelValues(queue).Observe(now - time) ageHistogram.WithLabelValues(queue).Observe(now - utime)
} }
} }
@ -663,12 +663,12 @@ func (e *PostfixExporter) Collect(ch chan<- prometheus.Metric) {
func main() { func main() {
var ( var (
app = kingpin.New("postfix_exporter", "Prometheus metrics exporter for postfix") app = kingpin.New("postfix_exporter", "Prometheus metrics exporter for postfix")
listenAddress = app.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9154").String() listenAddress = app.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9154").String()
metricsPath = app.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String() metricsPath = app.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
postfixShowqPath = app.Flag("postfix.showq_path", "Path at which Postfix places its showq socket.").Default("/var/spool/postfix/public/showq").String() postfixShowqPath = app.Flag("postfix.showq_path", "Path at which Postfix places its showq socket.").Default("/var/spool/postfix/public/showq").String()
postfixLogfilePath = app.Flag("postfix.logfile_path", "Path where Postfix writes log entries. This file will be truncated by this exporter.").Default("/var/log/postfix_exporter_input.log").String() postfixLogfilePath = app.Flag("postfix.logfile_path", "Path where Postfix writes log entries. This file will be truncated by this exporter.").Default("/var/log/postfix_exporter_input.log").String()
systemdEnable bool systemdEnable bool
systemdUnit, systemdSlice, systemdJournalPath string systemdUnit, systemdSlice, systemdJournalPath string
) )
systemdFlags(&systemdEnable, &systemdUnit, &systemdSlice, &systemdJournalPath, app) systemdFlags(&systemdEnable, &systemdUnit, &systemdSlice, &systemdJournalPath, app)