Merge pull request #64 from k-kinzal/fixes-systemd-support

fixes an issue where can't get metrics in systemd journal
This commit is contained in:
Bart Vercoulen 2021-03-12 10:52:58 +01:00 committed by GitHub
commit 40c13b6ca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -613,7 +613,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()
@ -701,7 +701,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