-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
metrics: show system boots in metrics #21444
Conversation
53184f5
to
3472780
Compare
3472780
to
c8e37bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some small stuff, but by and large looks good. I don't have an off-hand idea why it doesn't work on Ubuntu. Does that reproduce locally or is it a race?
The arch failure is weird, though:
wait_js_cond(ph_in_text(".metrics-minute[data-minute='35']","Boot")): Error: actual text: 10:35 AMBoot
Like what now? The text is right there!?
Will check locally but so far wasn't able to reproduce any of this locally.
Right, can't reproduce this, so assume it is a race. |
c8e37bf
to
4bddc82
Compare
@@ -1621,8 +1639,24 @@ class MetricsHistory extends React.Component { | |||
} catch (_ex) {} | |||
|
|||
const isBeibootBridge = cmdline?.includes("ic# cockpit-bridge"); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops! Can fix in a repush
On Ubuntu the journal doesn't seem to get picked up?
Versus for example Arch:
The journal entries for Ubuntu:
For arch:
|
Show a boot as an metric event in the historical metrics overview. A boot is likely to cause a high CPU/memory spikes so it is interesting for a system administrator to be aware of them. We obtain the boot information from systemd as `last` is deprecated and not all distros use lastlog2, while `journalctl` is available everywhere. Fixes cockpit-project#15983
So on Ubuntu, even if I remove all other system*.journal files and rename journal.journal to system.journal, the list-boots list is still wrong:
|
4bddc82
to
38caa31
Compare
I pushed this rather simple diff (not quite simple to come up with it, but wrt. review): --- test/verify/check-metrics
+++ test/verify/check-metrics
@@ -440,7 +440,10 @@ class TestHistoryMetrics(testlib.MachineCase):
return
m.upload(["verify/files/metrics-archives/journal.journal.gz"], "/tmp")
+ # we need to move all other existing journals out of the way, otherwise boot order is going back in time
m.execute("""gunzip /tmp/journal.journal.gz
+ systemctl stop systemd-journald
+ rm /var/log/journal/*/*.journal
cp /tmp/journal.journal /var/log/journal/*/""")
b.reload()
b.enter_page("/metrics")
This works for me locally. Let the bots have their deliberations! |
} catch (exc) { | ||
console.warn("journalctl --list-boots failed", exc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test.
Show a boot as an metric event in the historical metrics overview. A boot is likely to cause a high CPU/memory spikes so it is interesting for a system administrator to be aware of them. We obtain the boot information from systemd as
last
is deprecated and not all distros use lastlog2 whilejournalctl
is freely available.Closes: #15983
Show system boot in metrics