Migrate Core GitLab Systems to the LabKit v2 Log Package
## Participants
* @M_Alvarez
## Summary
This epic tracks the migration of GitLab's core Go-based systems to use Go's standard `slog` package for structured logging. This migration is a prerequisite for consolidating our logging setup into Labkit and ensuring consistency across our observability stack.
## Goals
- Migrate core GitLab Go systems to use `slog` for structured logging
- Establish migration patterns and best practices that other teams can follow
- De-risk the consolidation of logging setup into Labkit by making incremental changes
- Ensure backward compatibility during the migration period
- Validate that `slog` meets our performance and functionality requirements in production
## Execution Flow
This epic will have to be tackled in roughly this order:
1. **GitLab Shell** - this will give us some degree of confidence in the new package and enable us to identify a more comprehensive list of requirements for our v2 logging package.
2. **HTTP Access Logger Design -** we'll need to provide a way for the v2 Log package to either work with the existing http access logger, or build a new slog-based one that we can use for subsqeuent migrations.
3. **GitLab Workhorse** - this might be one of the simpler of the remaining services to migrate - with 31 identified package imports across the system.
4. **GitLab Pages** - Static site hosting service
5. **GitLab Container Registry** - Container image registry
6. **Other Go services** - Additional Go-based services as identified
## Migration Strategy
### Phase 1: Proof of Concept
- Select a low-risk service or component for initial migration
- Validate `slog` performance and functionality
- Document migration patterns and gotchas
- Create reusable migration utilities/helpers
### Phase 2: Core Services Migration
- Migrate high-priority services one at a time
- Monitor for performance regressions or issues
- Gather feedback from service owners
- Refine migration patterns based on learnings
### Phase 3: Remaining Services
- Complete migration of remaining Go services
- Deprecate old logging implementations
- Update documentation and guidelines
## Success Criteria
- [x] Foundation is laid for Labkit log package integration
- [ ] All core Go services are using the LabKit v2 Log package for structured logging
- [ ] No performance regressions observed in production
- [ ] Migration patterns documented and shared
- [ ] Linters have been updated for all services to ensure we do not introduce any other logging packages
## Risks and Mitigations
**Risk**: Performance impact on high-traffic services
- **Mitigation**: Thorough benchmarking and gradual rollout with monitoring
**Risk**: Breaking changes to existing log consumers
- **Mitigation**: Maintain log format compatibility where possible, communicate changes clearly
**Risk**: Custom logging requirements not met by `slog`
- **Mitigation**: Leverage `slog`'s handler interface for customization
## Related Work
- Parent Epic: #235 - Defining Logging Standards for Developers
- Related Epic: Implement Labkit Log Package using slog (to be created)
- Design Doc: [Observability Field Standardisation](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/observability_field_standardisation/)
### Status
<!-- STATUS NOTE START -->
## Status 2026-07-09
:clock1: **total hours spent this week by all contributors**: 8
:tada: **achievements**:
* Opened third MR, migrating the bulk of Workhorse global logging call sites to the new V2 package / slog.
* [Initial steps made toward defining slog usage standards](https://gitlab.com/gitlab-org/labkit/-/work_items/125); supporting guidance for developers adoption the new package
:issue-blocked:: **blockers**:
* None
:arrow_forward: **next**:
* Land a couple large Workhorse MRs migrating initially excluded logging sites (Context field logging, logs using in-project bespoke logging package, access logging)
* Document slog usage best practices
_Copied from https://gitlab.com/groups/gitlab-org/quality/-/epics/266#note_3539097743_
<!-- STATUS NOTE END -->
## Want to chat?
Join us in [#devex-log-field-migration-efforts](https://gitlab.enterprise.slack.com/archives/C09JQ7L1QDS) on Slack
epic