Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow suppressing timestamps in logs #239

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented Jul 21, 2023

Having double timestamps when running under systemd makes no sense:

$ sudo journalctl -n 4 -u ebpf_exporter
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Started with capabilities: "cap_syslog,cap_perfmon,cap_bpf=eip"
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Dropped capabilities to "cap_syslog=ep"
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Started with 1 programs found in the config in 15ms
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Listening on fd://0

With --log.no-timestamps:

ivan@vm:~/projects/ebpf_exporter$ sudo journalctl -n 4 -u ebpf_exporter
Jul 21 00:04:39 vm ebpf_exporter[25099]: Started with capabilities: "cap_syslog,cap_perfmon,cap_bpf=eip"
Jul 21 00:04:39 vm ebpf_exporter[25099]: Dropped capabilities to "cap_syslog=ep"
Jul 21 00:04:39 vm ebpf_exporter[25099]: Started with 1 programs found in the config in 16ms
Jul 21 00:04:39 vm ebpf_exporter[25099]: Listening on fd://0

Having double timestamps when running under systemd makes no sense:

```
$ sudo journalctl -n 4 -u ebpf_exporter
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Started with capabilities: "cap_syslog,cap_perfmon,cap_bpf=eip"
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Dropped capabilities to "cap_syslog=ep"
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Started with 1 programs found in the config in 15ms
Jul 20 04:37:36 vm ebpf_exporter[23736]: 2023/07/20 04:37:36 Listening on fd://0
```

With `--log.no-timestamps`:

```
ivan@vm:~/projects/ebpf_exporter$ sudo journalctl -n 4 -u ebpf_exporter
Jul 21 00:04:39 vm ebpf_exporter[25099]: Started with capabilities: "cap_syslog,cap_perfmon,cap_bpf=eip"
Jul 21 00:04:39 vm ebpf_exporter[25099]: Dropped capabilities to "cap_syslog=ep"
Jul 21 00:04:39 vm ebpf_exporter[25099]: Started with 1 programs found in the config in 16ms
Jul 21 00:04:39 vm ebpf_exporter[25099]: Listening on fd://0
```
@bobrik bobrik merged commit 51aa663 into cloudflare:master Jul 21, 2023
7 checks passed
@bobrik bobrik deleted the ivan/no-timestamps branch July 21, 2023 01:42
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.

1 participant