Skip to content

fix: improve observability on self-hosted runners#23

Open
dnwe wants to merge 6 commits into
kondukto-io:mainfrom
dnwe:housekeeping
Open

fix: improve observability on self-hosted runners#23
dnwe wants to merge 6 commits into
kondukto-io:mainfrom
dnwe:housekeeping

Conversation

@dnwe

@dnwe dnwe commented Apr 27, 2026

Copy link
Copy Markdown

Whilst trying kntrl out on self-hosted runners I found the daemon would appear to be running fine, but would fail to log any events. Digging into the code, there were a bunch of places that seemed to sends logs to /dev/null and assume the backend tracer was running as long as it briefly started.

Here’s a series of discrete commits to make this easier to debug things on self-hosted runners

dnwe added 6 commits April 27, 2026 12:38
The Fatalf calls in pkg/ebpf/loader.go terminated the process before
the returned error could reach the caller, which made daemonised
runs silently die when stdout/stderr were detached.
ebpf.NewCollection allocates BPF maps which require unlimited
RLIMIT_MEMLOCK on kernels older than 5.11. The previous ordering
called rlimit.RemoveMemlock only after the collection was already
loaded, so the map allocation could fail with EPERM.
qwm calls os.Exit, so the pidfile removal that followed the not-running
message was unreachable. Reorder so a stale pidfile is removed first
when the recorded process has gone away.
When the start command daemonises, exec.Cmd would default the child
stdout and stderr to /dev/null, hiding every log line, BPF load failure,
and capability error. Instead ppen a persistent log file at
/var/log/kntrl.log and report its path alongside the PID so the user
knows where to look.
Previously the parent reported "Process started with PID" the
moment exec.Cmd.Start returned, even when the child crashed
immediately afterwards loading eBPF programs. The pidfile, status
command, and operator were all left believing kntrl was running.

Instead pass an inherited pipe fd through KNTRL_READY_FD and have the
tracer write a single byte after eBPF programs are attached. The parent
blocks on the read end with a 15s timeout before recording the pid.
Emits a short report at startup covering the running user, kernel
release, RLIMIT_MEMLOCK, presence of a cgroup v2 unified hierarchy, and
BTF availability. These are the conditions that are most often to break
eBPF on self-hosted CI runners and managed nodes.
@dnwe
dnwe marked this pull request as ready for review May 8, 2026 13:46
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