This commit exposes the last 10 high priority logs as metrics so that the systemd-report reports them. The entries are reported as `io.systemd.Journal.HighPriorityMessage` and include all field as the new METRIC_FAMILY_TYPE_OBJECT. Individual fields from a journal entry that are unprintable (invalid utf-8) are skipped. This is archived via a new socket-activated unit listens on /run/systemd/report/io.systemd.Journal
29 lines
797 B
SYSTEMD
29 lines
797 B
SYSTEMD
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#
|
|
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Journal Metrics Report Socket
|
|
Documentation=man:journalctl(1)
|
|
DefaultDependencies=no
|
|
Before=sockets.target
|
|
After=systemd-sysusers.service
|
|
|
|
[Socket]
|
|
ListenStream=/run/systemd/report/io.systemd.Journal
|
|
FileDescriptorName=varlink
|
|
# Same permissions as systemd-journalctl.socket for io.systemd.JournalAccess
|
|
SocketGroup=systemd-journal
|
|
SocketMode=0660
|
|
Accept=yes
|
|
MaxConnectionsPerSource=16
|
|
RemoveOnStop=yes
|
|
|
|
[Install]
|
|
WantedBy=sockets.target
|