Skip to content

Comments

[slack-22.0] Forward port structured logging#788

Merged
tanjinx merged 3 commits intoslack-22.0from
forward-port-structured-logging
Feb 4, 2026
Merged

[slack-22.0] Forward port structured logging#788
tanjinx merged 3 commits intoslack-22.0from
forward-port-structured-logging

Conversation

@tanjinx
Copy link

@tanjinx tanjinx commented Feb 3, 2026

Description

forward port:

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

AI Disclosure

timvaillancourt and others added 2 commits February 3, 2026 11:42
* Install zap log and noglog

Signed-off-by: Emad Habib <ehabib@slack-corp.com>

* Implement the Vitess Structure Logger VTSLoger

Signed-off-by: Emad Habib <ehabib@slack-corp.com>

* Move the structure logging code to logger.go file

* make PR suggestions from vitessio#13061

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix bad merge conflict

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix bad merge conflict again

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix test

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* add flags e2e test for vtgateclienttest

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* update error msg

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

---------

Signed-off-by: Emad Habib <ehabib@slack-corp.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: Emad Habib <ehabib@slack-corp.com>
Co-authored-by: Emad Mokhtar <me@emadmokhtar.com>
* `slack-19.0`: fix structured logging

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* remove debug println

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* test cleanup

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* update flags and e2e tests

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix e2e flag test

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* code cleanup

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* simplify

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix goimports

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* log_dir WIP

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

---------

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
@tanjinx tanjinx requested a review from a team as a code owner February 3, 2026 19:44
@github-actions github-actions bot added this to the v22.0.2 milestone Feb 3, 2026
The cherry-picked structured logging commits added the flags to
RegisterFlags() but not to RegisterFlagsWithTimeouts(). This caused
mysqlctld (which uses RegisterFlagsWithTimeouts) to not have the
structured logging flags available.

This commit adds the --structured-logging and --structured-log-level
flags to RegisterFlagsWithTimeouts() to match RegisterFlags().

Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 66.66667% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.76%. Comparing base (1c15762) to head (2cdada3).

Files with missing lines Patch % Lines
go/vt/logutil/logger.go 75.00% 13 Missing ⚠️
go/vt/servenv/servenv.go 36.36% 7 Missing ⚠️
go/vt/servenv/servenv_unix.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           slack-22.0     #788      +/-   ##
==============================================
+ Coverage       69.75%   69.76%   +0.01%     
==============================================
  Files            1605     1605              
  Lines          213624   213689      +65     
==============================================
+ Hits           149011   149086      +75     
+ Misses          64613    64603      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tanjinx tanjinx merged commit 3a6de8d into slack-22.0 Feb 4, 2026
86 of 92 checks passed
@tanjinx tanjinx deleted the forward-port-structured-logging branch February 4, 2026 01:05
sbaker617 pushed a commit that referenced this pull request Feb 5, 2026
* `slack-19.0`: add structured logging (#449)

* Install zap log and noglog

Signed-off-by: Emad Habib <ehabib@slack-corp.com>

* Implement the Vitess Structure Logger VTSLoger

Signed-off-by: Emad Habib <ehabib@slack-corp.com>

* Move the structure logging code to logger.go file

* make PR suggestions from vitessio#13061

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix bad merge conflict

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Fix bad merge conflict again

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix test

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* add flags e2e test for vtgateclienttest

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* update error msg

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

---------

Signed-off-by: Emad Habib <ehabib@slack-corp.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: Emad Habib <ehabib@slack-corp.com>
Co-authored-by: Emad Mokhtar <me@emadmokhtar.com>

* `slack-19.0`: fix structured logging (#532)

* `slack-19.0`: fix structured logging

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* remove debug println

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* test cleanup

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* update flags and e2e tests

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix e2e flag test

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* code cleanup

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* simplify

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* fix goimports

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* log_dir WIP

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

---------

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>

* Add structured logging flags to RegisterFlagsWithTimeouts

The cherry-picked structured logging commits added the flags to
RegisterFlags() but not to RegisterFlagsWithTimeouts(). This caused
mysqlctld (which uses RegisterFlagsWithTimeouts) to not have the
structured logging flags available.

This commit adds the --structured-logging and --structured-log-level
flags to RegisterFlagsWithTimeouts() to match RegisterFlags().

Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

---------

Signed-off-by: Emad Habib <ehabib@slack-corp.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com>
Co-authored-by: Emad Habib <ehabib@slack-corp.com>
Co-authored-by: Emad Mokhtar <me@emadmokhtar.com>
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants