prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
11.23k stars 2.36k forks source link

node_exporter cannot collect node_systemd_service_restart_total information #2750

Closed irenesrl closed 7 months ago

irenesrl commented 1 year ago

Host operating system: output of uname -a

Linux ip-10-105-12-155.eu-central-1.compute.internal 5.10.144-127.601.amzn2.x86_64 #1 SMP Thu Sep 29 01:11:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 1.4.0 (branch: HEAD, revision: 7da1321761b3b8dfc9e496e1a60e6a476fec6018) build user: root@83d90983e89c build date: 20220926-12:32:56 go version: go1.19.1 platform: linux/amd64

node_exporter command line flags

[Unit] Description=Node Exporter Service After=network.target network-online.target remote-fs.target

[Service] ExecStart=/opt/node_exporter/node_exporter --collector.systemd --collector.systemd.enable-restarts-metrics --collector.ntp Restart=always RestartSec=60 StartLimitInterval=3600 StartLimitBurst=5

[Install] WantedBy=multi-user.target

node_exporter log output

Jul 12 03:26:39 ip-10-105-12-155.eu-central-1.compute.internal systemd[1]: Started Node Exporter Service. Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.017Z caller=node_exporter.go:182 level=info msg="Starting node_exporter" version="(version=1.4.0, branch=HEAD, revision=7da1321761b3b8dfc9e496e1a60e6a476fec6018)" Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.017Z caller=node_exporter.go:183 level=info msg="Build context" build_context="(go=go1.19.1, user=root@83d90983e89c, date=20220926-12:32:56)" Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.017Z caller=node_exporter.go:185 level=warn msg="Node Exporter is running as root user. This exporter is designed to run as unprivileged user, root is not required." Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.018Z caller=systemd_linux.go:152 level=info collector=systemd msg="Parsed flag --collector.systemd.unit-include" flag=.+ Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.018Z caller=systemd_linux.go:154 level=info collector=systemd msg="Parsed flag --collector.systemd.unit-exclude" flag=.+.(automount|device|mount|scope|slice) Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.018Z caller=diskstats_common.go:100 level=info collector=diskstats msg="Parsed flag --collector.diskstats.device-exclude" flag=^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\d+n\d+p)\d+$ Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=filesystem_common.go:111 level=info collector=filesystem msg="Parsed flag --collector.filesystem.mount-points-exclude" flag=^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+)($|/) Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=filesystem_common.go:113 level=info collector=filesystem msg="Parsed flag --collector.filesystem.fs-types-exclude" flag=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$ Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:108 level=info msg="Enabled collectors" Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=arp Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=bcache Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=bonding Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=btrfs Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=conntrack Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=cpu Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=cpufreq Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=diskstats Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=dmi Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=edac Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=entropy Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=fibrechannel Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=filefd Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=filesystem Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=hwmon Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=infiniband Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=ipvs Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=loadavg Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=mdadm Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=meminfo Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=netclass Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=netdev Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=netstat Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=nfs Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=nfsd Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=ntp Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=nvme Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=os Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=powersupplyclass Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=pressure Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=rapl Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=schedstat Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=selinux Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=sockstat Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=softnet Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=stat Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=systemd Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=tapestats Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=textfile Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=thermal_zone Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=time Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=timex Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=udp_queues Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=uname Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=vmstat Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=xfs Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:115 level=info collector=zfs Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.019Z caller=node_exporter.go:199 level=info msg="Listening on" address=:9100 Jul 12 03:26:43 ip-10-105-12-155.eu-central-1.compute.internal node_exporter[2950]: ts=2023-07-12T03:26:43.020Z caller=tls_config.go:195 level=info msg="TLS is disabled." http2=false

Are you running node_exporter in Docker?

no

What did you do that produced an error?

No error but get the node_systemd_service_restart_total metrics is empty: eg: curl localhost:9100/metrics |grep node_systemd_service_restart_total % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 145k 0 145k 0 0 3215k 0 --:--:-- --:--:-- --:--:-- 3238k

What did you expect to see?

I hope that the process restart information can be obtained through curl metrics,eg: HELP node_systemd_service_restart_total Service unit count of Restart triggers TYPE node_systemd_service_restart_total counter node_systemd_service_restart_total{name="acpid.service"} 0 node_systemd_service_restart_total{name="amazon-ssm-agent.service"} 0 node_systemd_service_restart_total{name="atd.service"} 0 node_systemd_service_restart_total{name="auditd.service"} 0 node_systemd_service_restart_total{name="auth-rpcgss-module.service"} 0 node_systemd_service_restart_total{name="chrony-config.service"} 0 node_systemd_service_restart_total{name="chronyd.service"} 0 node_systemd_service_restart_total{name="cloud-config.service"} 0 node_systemd_service_restart_total{name="cloud-final.service"} 0 node_systemd_service_restart_total{name="cloud-init-local.service"} 0 node_systemd_service_restart_total{name="cloud-init.service"} 0 node_systemd_service_restart_total{name="crond.service"} 0 node_systemd_service_restart_total{name="dbus-broker.service"} 0 node_systemd_service_restart_total{name="dracut-cmdline.service"} 0 node_systemd_service_restart_total{name="dracut-initqueue.service"} 0 node_systemd_service_restart_total{name="dracut-mount.service"} 0 node_systemd_service_restart_total{name="dracut-pre-mount.service"} 0 node_systemd_service_restart_total{name="dracut-pre-pivot.service"} 0 node_systemd_service_restart_total{name="dracut-pre-trigger.service"} 0 node_systemd_service_restart_total{name="dracut-pre-udev.service"} 0 node_systemd_service_restart_total{name="dracut-shutdown.service"} 0 node_systemd_service_restart_total{name="emergency.service"} 0 node_systemd_service_restart_total{name="fstrim.service"} 0 node_systemd_service_restart_total{name="getty@tty1.service"} 0 node_systemd_service_restart_total{name="gssproxy.service"} 0 node_systemd_service_restart_total{name="hibinit-agent.service"} 0 node_systemd_service_restart_total{name="import-state.service"} 0 node_systemd_service_restart_total{name="initrd-cleanup.service"} 0 node_systemd_service_restart_total{name="initrd-parse-etc.service"} 0 node_systemd_service_restart_total{name="initrd-switch-root.service"} 0 node_systemd_service_restart_total{name="initrd-udevadm-cleanup-db.service"} 0 node_systemd_service_restart_total{name="irqbalance.service"} 0 node_systemd_service_restart_total{name="kmod-static-nodes.service"} 0 node_systemd_service_restart_total{name="ldconfig.service"} 0 node_systemd_service_restart_total{name="libstoragemgmt.service"} 0 node_systemd_service_restart_total{name="logrotate.service"} 0、 node_systemd_service_restart_total{name="modprobe@configfs.service"} 0 node_systemd_service_restart_total{name="modprobe@drm.service"} 0 node_systemd_service_restart_total{name="modprobe@efi_pstore.service"} 0 node_systemd_service_restart_total{name="modprobe@fuse.service"} 0 node_systemd_service_restart_total{name="nfs-blkmap.service"} 0 node_systemd_service_restart_total{name="nfs-convert.service"} 0 node_systemd_service_restart_total{name="nfs-idmapd.service"} 0 node_systemd_service_restart_total{name="nfs-mountd.service"} 0 node_systemd_service_restart_total{name="nfs-server.service"} 0 node_systemd_service_restart_total{name="nfs-utils.service"} 0 node_systemd_service_restart_total{name="nfsdcld.service"} 0 node_systemd_service_restart_total{name="node_exporter.service"} 0 node_systemd_service_restart_total{name="policy-routes@ens5.service"} 0 node_systemd_service_restart_total{name="rc-local.service"} 0 node_systemd_service_restart_total{name="refresh-policy-routes@ens5.service"} 0 node_systemd_service_restart_total{name="rescue.service"} 0 node_systemd_service_restart_total{name="rngd.service"} 0 node_systemd_service_restart_total{name="rpc-gssd.service"} 0 node_systemd_service_restart_total{name="rpc-statd-notify.service"} 0 node_systemd_service_restart_total{name="rpc-statd.service"} 0 node_systemd_service_restart_total{name="rpcbind.service"} 0 node_systemd_service_restart_total{name="rpmdb-rebuild.service"} 0 node_systemd_service_restart_total{name="selinux-autorelabel-mark.service"} 0 node_systemd_service_restart_total{name="serial-getty@ttyS0.service"} 0 node_systemd_service_restart_total{name="sshd-keygen@ecdsa.service"} 0 node_systemd_service_restart_total{name="sshd-keygen@ed25519.service"} 0 node_systemd_service_restart_total{name="sshd-keygen@rsa.service"} 0 node_systemd_service_restart_total{name="sshd.service"} 0 node_systemd_service_restart_total{name="sssd-kcm.service"} 0 node_systemd_service_restart_total{name="sssd.service"} 0 node_systemd_service_restart_total{name="sysstat-collect.service"} 0 node_systemd_service_restart_total{name="sysstat-summary.service"} 0 node_systemd_service_restart_total{name="sysstat.service"} 0 node_systemd_service_restart_total{name="systemd-ask-password-console.service"} 0 node_systemd_service_restart_total{name="systemd-ask-password-wall.service"} 0 node_systemd_service_restart_total{name="systemd-binfmt.service"} 0 node_systemd_service_restart_total{name="systemd-firstboot.service"} 0 node_systemd_service_restart_total{name="systemd-fsck-root.service"} 0 node_systemd_service_restart_total{name="systemd-fsck@dev-disk-by\x2duuid-ECFE\x2d5555.service"} 0 node_systemd_service_restart_total{name="systemd-homed-activate.service"} 0 node_systemd_service_restart_total{name="systemd-homed.service"} 0 node_systemd_service_restart_total{name="systemd-hwdb-update.service"} 0 node_systemd_service_restart_total{name="systemd-initctl.service"} 0 node_systemd_service_restart_total{name="systemd-journal-catalog-update.service"} 0 node_systemd_service_restart_total{name="systemd-journal-flush.service"} 0 node_systemd_service_restart_total{name="systemd-journald.service"} 0 node_systemd_service_restart_total{name="systemd-logind.service"} 0 node_systemd_service_restart_total{name="systemd-machine-id-commit.service"} 0 node_systemd_service_restart_total{name="systemd-modules-load.service"} 0 node_systemd_service_restart_total{name="systemd-network-generator.service"} 0 node_systemd_service_restart_total{name="systemd-networkd-wait-online.service"} 0 node_systemd_service_restart_total{name="systemd-networkd.service"} 0 node_systemd_service_restart_total{name="systemd-pstore.service"} 0 node_systemd_service_restart_total{name="systemd-quotacheck.service"} 0 node_systemd_service_restart_total{name="systemd-random-seed.service"} 0 node_systemd_service_restart_total{name="systemd-remount-fs.service"} 0 node_systemd_service_restart_total{name="systemd-repart.service"} 0 node_systemd_service_restart_total{name="systemd-resolved.service"} 0 node_systemd_service_restart_total{name="systemd-sysctl.service"} 0 node_systemd_service_restart_total{name="systemd-sysusers.service"} 0 node_systemd_service_restart_total{name="systemd-timesyncd.service"} 0 node_systemd_service_restart_total{name="systemd-tmpfiles-clean.service"} 0 node_systemd_service_restart_total{name="systemd-tmpfiles-setup-dev.service"} 0 node_systemd_service_restart_total{name="systemd-tmpfiles-setup.service"} 0 node_systemd_service_restart_total{name="systemd-udev-settle.service"} 0 node_systemd_service_restart_total{name="systemd-udev-trigger.service"} 0 node_systemd_service_restart_total{name="systemd-udevd.service"} 0 node_systemd_service_restart_total{name="systemd-update-done.service"} 0 node_systemd_service_restart_total{name="systemd-update-utmp-runlevel.service"} 0 node_systemd_service_restart_total{name="systemd-update-utmp.service"} 0 node_systemd_service_restart_total{name="systemd-user-sessions.service"} 0 node_systemd_service_restart_total{name="systemd-userdbd.service"} 0 node_systemd_service_restart_total{name="systemd-vconsole-setup.service"} 0 node_systemd_service_restart_total{name="update-motd.service"} 0 node_systemd_service_restart_total{name="user-runtime-dir@0.service"} 0 node_systemd_service_restart_total{name="user-runtime-dir@1000.service"} 0 node_systemd_service_restart_total{name="user@0.service"} 0 node_systemd_service_restart_total{name="user@1000.service"} 0

What did you see instead?

curl mertics get null value

discordianfish commented 1 year ago

Hrm odd, maybe a difference in systemd version? What systemd version are you using? Curious if https://github.com/prometheus/node_exporter/blob/8fb4f78ce541f404144f86b3202cc53d2a0f387c/collector/systemd_linux.go#L449 retunrs all units including the .service prefix we check for later..

irenesrl commented 1 year ago

Hi, I checked that the systemd version is 219, is this version supported ? systemctl --version systemd 219 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN

irenesrl commented 1 year ago

By the way, I compared another machine that can collect node_systemd_service_restart_total. Its systemd version is 252, and the configuration of the rest of node_expoter is the same, so it may be a problem with the systemd version? systemctl --version systemd 252 (252.4-1161.amzn2023.0.3) +PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP -GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 -BZIP2 -LZ4 +XZ -ZLIB -ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

chengjoey commented 11 months ago

hi @irenesrl @discordianfish restart wasn't added until systemd 235 https://github.com/prometheus/node_exporter/blob/9666d002487039ac66b20287998945461eefe746/collector/systemd_linux.go#L298-L300

if you enable log as debug level, and running exporter in systemctl 219, you could get logs like this:

ts=2023-12-08T05:50:33.109Z caller=systemd_linux.go:302 collector=systemd msg="couldn't get unit NRestarts" unit=systemd-binfmt.service err="Unknown property or interface."
ts=2023-12-08T05:50:33.109Z caller=systemd_linux.go:302 collector=systemd msg="couldn't get unit NRestarts" unit=nfs-utils.service err="Unknown property or interface."
ts=2023-12-08T05:50:33.110Z caller=systemd_linux.go:302 collector=systemd msg="couldn't get unit NRestarts" unit=aegis.service err="Unknown property or interface."
ts=2023-12-08T05:50:33.110Z caller=systemd_linux.go:302 collector=systemd msg="couldn't get unit NRestarts" unit=plymouth-quit.service err="Unknown property or interface."
ts=2023-12-08T05:50:33.111Z caller=systemd_linux.go:302 collector=systemd msg="couldn't get unit NRestarts" unit=chronyd.service err="Unknown property or interface."
rexagod commented 8 months ago

ACK, seems like this can be closed now.