Skip to content

feat(logs): collect kernel crash dumps via systemd journal (systemd-pstore.service)#1808

Closed
timojohlo wants to merge 1 commit into
mainfrom
feat/logs-pstore-receiver
Closed

feat(logs): collect kernel crash dumps via systemd journal (systemd-pstore.service)#1808
timojohlo wants to merge 1 commit into
mainfrom
feat/logs-pstore-receiver

Conversation

@timojohlo

@timojohlo timojohlo commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Collect kernel crash dumps (panics, MCEs) from the systemd journal instead of reading files under /var/lib/systemd/pstore/. This removes a hostPath volume mount and works regardless of Storage= mode in /etc/systemd/pstore.conf.

Gated by kvmConfig.enabled.

  • Adds journald/pstore receiver filtered on _SYSTEMD_UNIT=systemd-pstore.service (units:), with merge: true (required — the collector container has /var/log/journal mounted but not /run/log/journal), start_at: beginning, all: true.
  • Adds transform/pstore extracting MESSAGE, FILE, _BOOT_ID, _HOSTNAME, _SYSTEMD_UNIT from log.body into attributes / resource attributes, and tagging config.parsed: pstore.
  • Adds dedicated logs/kvm_pstore pipeline (no k8s_attributes — host-level source).
  • Chart / plugindefinition version bump 0.4.12 -> 0.4.13 / 0.15.12 -> 0.15.13.

Why journald and not the file directory

systemd-pstore.service always logs pstore contents to the journal via sd_journal_sendv(), independent of Storage= — the FILE= field contains the raw dmesg payload, MESSAGE= is the summary. See src/pstore/pstore.c (move_file()). Works with both Storage=external (default; files + journal) and Storage=journal (journal only).

Verification

@timojohlo
timojohlo force-pushed the feat/logs-pstore-receiver branch 2 times, most recently from 770b1c1 to 6887a63 Compare July 10, 2026 13:08
…store.service)

systemd-pstore.service always logs pstore contents to the journal via
sd_journal_sendv() regardless of the Storage= setting (see systemd's
src/pstore/pstore.c: /* Always log to the journal */). Each entry carries
MESSAGE=PStore <filename> ... and FILE=<raw dmesg payload>. We can therefore
pick up kernel panic/MCE dumps directly from journald and skip the
hostPath mount on /var/lib/systemd/pstore.

Changes (gated by kvmConfig.enabled):
- journald/pstore receiver with units=[systemd-pstore.service] and merge=true
  (merge=true is required because the collector container has /var/log/journal
  mounted but not /run/log/journal; without --merge journalctl finds nothing)
- transform/pstore extracts MESSAGE, FILE, _BOOT_ID, _HOSTNAME, _SYSTEMD_UNIT
  from log.body into attributes/resource
- dedicated logs/kvm_pstore pipeline (no k8s_attributes; source is host-level)
- removed file_log/pstore receiver, transform, and /var/lib/systemd/pstore
  hostPath volume mount

Works with both Storage=external (default) and Storage=journal in
/etc/systemd/pstore.conf.

Verified end-to-end on cc-b0-qa-de-1:
- helm install rolled out 13/13 daemonset pods clean
- receiver command emits journalctl ... --unit systemd-pstore.service --merge
- synthetic pstore entry (via systemd-pstore.service drop-in override) flowed
  through: otelcol_receiver_accepted_log_records_total went 13 -> 18 with 0
  failures and 0 refusals
@timojohlo
timojohlo force-pushed the feat/logs-pstore-receiver branch from 6887a63 to 0d3e891 Compare July 13, 2026 08:41
@timojohlo timojohlo changed the title feat(logs): add pstore filelog receiver for kernel crash dump collection feat(logs): collect kernel crash dumps via systemd journal (systemd-pstore.service) Jul 13, 2026
@timojohlo timojohlo closed this Jul 15, 2026
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