Skip to content

Conversation

@dadicool
Copy link

No description provided.

silkeh and others added 30 commits January 28, 2018 15:09
The following flags configure this usage:

- systemd.enable:       enable collection from systemd.
- systemd.unit:         systemd unit, postfix.service by default.
- systemd.slice:        systemd slice, overrides the unit.
- systemd.journal_path: path to the systemd journal directory.

Closes #2
Implement collection from the systemd journal
Initialize histograms to zero
fixes #10 where metrics metrics collected from the
systemd journal were not updated after some time
fix non-updating metrics from systemd-journal
This allows building the exporter without systemd headers, eg:

    env CGO_ENABLED=0 go build -tags nosystemd

Closes #11
See,
$ gometalinter --vendor ./...
postfix_exporter.go:249::warning: Potential file inclusion via variable,MEDIUM,HIGH (gosec)
postfix_exporter.go:80::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:121::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:296::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:298::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:300::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:302::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:309::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:311::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:313::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:315::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:322::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:324::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:333::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:335::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:337::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:339::warning: Errors unhandled.,LOW,HIGH (gosec)
postfix_exporter.go:650::warning: Errors unhandled.,LOW,HIGH (gosec)
See,
$ gometalinter --vendor ./...
postfix_exporter.go:256:1:warning: CollectShowqFromFile is unused
(deadcode)
See,
$ gometalinter --vendor ./...
systemd.go:49::warning: Errors unhandled.,LOW,HIGH (gosec)
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
postfix_exporter.go:97:17:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:276:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:277:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:278:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:279:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:280:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:281:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:282:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:283:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:284:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)
postfix_exporter.go:285:40:warning: should use raw string (`...`) with regexp.MustCompile to avoid having to escape twice (S1007) (megacheck)

Signed-off-by: Mario Trangoni <[email protected]>
postfix_exporter.go: Fix megacheck issues
See these annoying messages,
Feb 06 13:34:03 hostname postfix_exporter[30713]: 2019/02/06 13:34:03 Could not read postfix output, EOF
Feb 06 13:34:27 hostname postfix_exporter[30713]: 2019/02/06 13:34:27 Could not read postfix output, EOF
Feb 06 13:35:27 hostname postfix_exporter[30713]: 2019/02/06 13:35:27 Could not read postfix output, EOF
Feb 06 13:36:27 hostname postfix_exporter[30713]: 2019/02/06 13:36:27 Could not read postfix output, EOF
Feb 06 13:37:27 hostname postfix_exporter[30713]: 2019/02/06 13:37:27 Could not read postfix output, EOF
Feb 06 13:38:27 hostname postfix_exporter[30713]: 2019/02/06 13:38:27 Could not read postfix output, EOF
Feb 06 13:39:27 hostname postfix_exporter[30713]: 2019/02/06 13:39:27 Could not read postfix output, EOF
Feb 06 13:40:27 hostname postfix_exporter[30713]: 2019/02/06 13:40:27 Could not read postfix output, EOF
Feb 06 13:41:27 hostname postfix_exporter[30713]: 2019/02/06 13:41:27 Could not read postfix output, EOF
Feb 06 13:42:27 hostname postfix_exporter[30713]: 2019/02/06 13:42:27 Could not read postfix output, EOF
postfix_exporter.go: Handle the case where EOF is reached.
Refactored to kingpin and bugfix.
BartVerc and others added 6 commits June 30, 2020 14:42
fix smtpd TLS connection regex
Provides a cleaner split between log sources, specifically for not
compiling with systemd libraries.

This is in preparation for a new log source to read from Docker.
When Postfix is running in a Docker container, it's most useful to use
the built-in Docker logging (as with Systemd). Setting
`--docker.enable` allows that.

The log source is using `client.NewEnvClient`, which reads environment
variables to determine which Docker to connect to, and how TLS is
handled.
BartVerc and others added 23 commits March 12, 2021 10:40
Changed bucket sizes for Time measurements
fixes an issue where can't get metrics in systemd journal
Adds a Docker log source.
Revert "Adds a Docker log source."
Provides a cleaner split between log sources, specifically for not
compiling with systemd libraries.

This is in preparation for a new log source to read from Docker.
When Postfix is running in a Docker container, it's most useful to use
the built-in Docker logging (as with Systemd). Setting
`--docker.enable` allows that.

The log source is using `client.NewEnvClient`, which reads environment
variables to determine which Docker to connect to, and how TLS is
handled.
Currently it does not always detect rotated logfiles. There are many issues in hpcloud/tail which are not addressed, hpcloud/tail looks dead. nxadm/tail is a fork which solved many known issues.
Update tail from hpcloud/tail to nxadm/tail
Add some new metrics when parsing postfix logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.