Repository navigation
logging: client side - #283
Conversation
|
this depends on #282, because it's calling the wrong endpoint (and that hasn't hooked yet). Can should be easy rebase.
for _, unit := range units {
// This is wrong because we're calling the wrong endpoints. Must be c.MachineLogs.
svc, ch, err := c.ServiceLogs(ctx, unit, logsOpts)
if err != nil {
return fmt.Errorf("stream logs for systemd service '%s': %w", unit, err)
}
unitStreams = append(unitStreams, ch)
machineIDs := svc.MachineIDs()
machineIDsSet.Append(machineIDs...)
}not relevant anymore |
Create internal/logs and put abstracted way service and machine logging in there This adds the bits to do machine logging of the services. See psviderski#273 and discussion in psviderski#158 Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
72c6f63 to
87b81d9
Compare
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
|
ok, this is starting work, but casting stuff to ServiceLogEntry makes it slightly weird. Now cleaning up and cutting down the amount of change |
server side: |
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
|
geh, seems to work fine. Only |
Signed-off-by: Miek Gieben <[email protected]>
Signed-off-by: Miek Gieben <[email protected]>
| } | ||
|
|
||
| // Enrich log entries from the machine with metadata. | ||
| metadata := api.ServiceLogEntryMetadata{ |
There was a problem hiding this comment.
I'm in favor of keeping this, and putting unit as ServiceName or some such.
|
@psviderski this works, and code looks reasonable to me. PTAL |
Signed-off-by: Miek Gieben <[email protected]>
|
@miekg FYI Note that uncloud/pkg/client/logmerger.go Line 15 in cef0472 But I haven't seen this behaviour for service logs. So I suspect we're not correctly handling timestamps and heartbeats when streaming journal logs. |
|
Geh. Of course...
I'll take look, prolly easy fix. Will try to figure out an easy way to test
this as well
…On Tue, Apr 21, 2026, 14:07 Pasha Sviderski ***@***.***> wrote:
*psviderski* left a comment (psviderski/uncloud#283)
<#283?email_source=notifications&email_token=AACWIW526STQJQ4MGBTS23L4W5P6TA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHAZTQMJWGQ22M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4288381645>
@miekg <https://github.com/miekg> FYI uc machine logs uncloud -f hangs in
my tests and prints a warning about stalled streams. Also zombie
journalctl processes start to appear on the remote machine(s):
ps ax | grep journal
242 ? Ss 21:59 /lib/systemd/systemd-journald
286152 ? Z 0:00 [journalctl] <defunct>
286153 ? Z 0:00 [journalctl] <defunct>
286180 ? Z 0:00 [journalctl] <defunct>
286181 ? Z 0:00 [journalctl] <defunct>
286197 ? Z 0:00 [journalctl] <defunct>
286218 ? Z 0:00 [journalctl] <defunct>
286219 ? Z 0:00 [journalctl] <defunct>
286230 ? Z 0:00 [journalctl] <defunct>
286238 ? Z 0:00 [journalctl] <defunct>
286248 ? Z 0:00 [journalctl] <defunct>
286479 ? Z 0:00 [journalctl] <defunct>
286487 ? Z 0:00 [journalctl] <defunct>
286488 ? Z 0:00 [journalctl] <defunct>
286496 ? Z 0:00 [journalctl] <defunct>
286497 ? Z 0:00 [journalctl] <defunct>
286499 ? Z 0:00 [journalctl] <defunct>
Note that -f -n N where N is any number < 100 works but hangs >=100. This
could be related to this constant:
https://github.com/psviderski/uncloud/blob/cef047221c4f103f2997837e2209a317c389319f/pkg/client/logmerger.go#L15
But I haven't seen this behaviour for service logs. So I suspect we're not
correctly handling timestamps and heartbeats when streaming journal logs.
—
Reply to this email directly, view it on GitHub
<#283?email_source=notifications&email_token=AACWIW526STQJQ4MGBTS23L4W5P6TA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRYHAZTQMJWGQ22M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4288381645>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACWIW4RNJ3IKWRSM7KWUFD4W5P6TAVCNFSM6AAAAACW3RREKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOBYGM4DCNRUGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
lol, ucind clusters use Alpine as the base image, that lacks journalctl as there is no systemd on those |
|
Yeah, ucind is not suitable for this. I'm testing on my hybrid dev cluster (2 local VMs + 1 free Oracle Cloud VM). https://github.com/psviderski/uncloud/blob/main/HACKING.md#manual-testing-on-dev-machines |
|
I can't replicate a hang, it just works and with #325 is also cleans up the |
Does the systemd service logs you're testing contain more than 100 lines already? Can you try |
|
copied uncloudd (compiles from my branch) to the machines started. My corrosion doesn't log very actively - not this is also a newer corrosion.. But: |
|
Ah, found the root cause of my issue with hanging. systemd <v255 prints an ISO datetime (
misses My Debian 12 machine (systemd v252) returns the datetime without the colon which fails to parse so the server returns Will implement a few fixes:
|
|
wow, nice find! And glad it's fixed. |
Create internal/logs and put abstracted way service and machine logging in there This adds the bits to do machine logging of the services.
See #273 and discussion in #158