From 4dda50457da7df47b33a6da36ede8b73604244ee Mon Sep 17 00:00:00 2001 From: cw-ozaki Date: Mon, 20 Jul 2020 22:12:44 +0900 Subject: [PATCH] fixes an issue where can't get metrics in systemd journal --- postfix_exporter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postfix_exporter.go b/postfix_exporter.go index b0e1089..787cb06 100644 --- a/postfix_exporter.go +++ b/postfix_exporter.go @@ -612,7 +612,7 @@ func NewPostfixExporter(showqPath string, logfilePath string, journal *Journal, func (e *PostfixExporter) Describe(ch chan<- *prometheus.Desc) { ch <- postfixUpDesc - if e.tailer == nil { + if e.tailer == nil && e.journal == nil { return } ch <- e.cleanupProcesses.Desc() @@ -700,7 +700,7 @@ func (e *PostfixExporter) Collect(ch chan<- prometheus.Metric) { e.showqPath) } - if e.tailer == nil { + if e.tailer == nil && e.journal == nil { return } ch <- e.cleanupProcesses