fixes an issue where can't get metrics in systemd journal

This commit is contained in:
cw-ozaki 2020-07-20 22:12:44 +09:00
parent 8e63fbbe8d
commit 4dda50457d

View File

@ -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