Skip to content

0048. Logs of the control plane

Date: 2026-10-28

The control plane’s pods logged little: a line at start, warnings when something failed. When a build did not show up, a job looked slow or the console seemed stale, kubectl logs could not say what had happened. Some output bypassed the log altogether: the HTTP servers’ own errors and client-go’s messages came as plain text, the disk probe used the default logger. The console handles GitLab tokens, session cookies and OAuth callbacks, and builds carry arguments and output that may be secret.

  • One logger per role (log/slog, standard library): one JSON object per line on stderr (-log-format=text for reading by eye), each with its role, at -log-level (default info). The HTTP servers’ error logs and client-go (klog) are bridged into it.
  • info is what changes state, bounded by the work, not by readers: a role’s start (with its settings), readiness, stop; every stored build, job start and end, change of the daemons, sign-in and sign-out, routed connection. debug adds what grows with page views and polling: every request, GitLab call, controller API call, closed connection. A warning that repeats while something is down is written once a minute with the count held back.
  • Never logged: tokens, cookies, session ids, query strings (an OAuth callback carries its code and state there), request bodies, build arguments, step output, Dockerfiles, commit titles. Every handler also replaces any attribute whose key names a credential, masks GitLab token formats and cuts the query of any address in a string. A test signs in and out through the pages and fails if the log holds a token, the client secret, a code, a state or a cookie.
  • Chart values log.level/format and a logLevel per role. BuildKit’s own [log] table and the disk probe’s level are rendered only when set: a default install’s daemons never restart for logging.

At about 9,000 jobs a day the info level writes a few lines per job (estimated 30,000-40,000 lines, under 10 MB a day for the cluster). Access logs belong to an Ingress at the edge; the console’s are debug only. There is no request id across web and controller yet.