Enable labkit logging field validator in the monolith
Summary
Enable the labkit logging field validator in the GitLab monolith. This validator detects usage of deprecated logging field names at runtime and supports iterative migration to standardized field names.
Background
The field validator was implemented in labkit-ruby MR !213 and performance-optimized in issue #60. It is now ready for monolith rollout.
Related epic: &338
Implementation
-
Update
gitlab-labkitgem to v1.3.4 (lockfile-only change, constraint~> 1.3.0already allows it)- Contains all performance optimizations from issue #60 (closed)
-
Add
.labkit_logging_todo.ymlto the monolith root withskip_ci_failure: truefor initial baseline generation - Run a CI pipeline to generate the initial baseline of field offenses
-
Use
labkit-logging fetchto populate the todo file from pipeline output
How It Works
- In non-production environments, the field validator intercepts
JsonLogger.format_datacalls - It detects deprecated field names (e.g.,
user_id→gl_user_id) and records the callsite - In CI, offenses are emitted as NDJSON lines (
LABKIT_LOGGING_OFFENSE: {...}) - The
labkit-logging fetchCLI tool collects offenses from CI jobs and updates the baseline - New offenses fail CI (once
skip_ci_failureis removed), preventing regressions
Acceptance Criteria
-
gitlab-labkitupdated to v1.3.4 inGemfile.lock -
.labkit_logging_todo.ymlcreated withskip_ci_failure: true - CI pipeline runs successfully with the validator enabled
- Initial baseline of offenses is captured
CI dashboards to track (performance)
Edited by Doug Barrett