Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slack-19.0: fix structured logging #532

Merged
merged 11 commits into from
Oct 17, 2024

Conversation

timvaillancourt
Copy link
Member

@timvaillancourt timvaillancourt commented Oct 12, 2024

Description

This PR fixes structure logging in v19 (introduced in #449) that is not being enabled due to a bug, although we set --structured-logging on daemons

Before:

tim@Tims-MacBook-Pro vitess % git checkout slack-19.0    
Already on 'slack-19.0'
Your branch is up to date with 'origin/slack-19.0'.
tim@Tims-MacBook-Pro vitess % make NOVTADMINBUILD=1 build
Sat Oct 12 03:33:56 CEST 2024: Building source tree
tim@Tims-MacBook-Pro vitess % ./bin/vttablet --tablet-path test-123456789 --structured-logging 2>&1 | head -3
W1012 19:22:23.163333   37461 log.go:39] Failed to read in config : Config File "vtconfig" Not Found in "[/Users/tim/github/slackhq/vitess]". This is optional, and can be ignored if you are not using config files. For a detailed explanation, see https://github.com/vitessio/vitess/blob/main/doc/viper/viper.md#config-files.
W1012 19:22:23.190138   37461 http.go:57] Beginning in v20, pprof-http will default to `false`; to continue enabling pprof endpoints, please manually set this flag before upgrading.
Error: mycnf read failed: open /vt/vt_0123456789/my.cnf: no such file or directory

After w/this PR:

tim@Tims-MacBook-Pro vitess % make NOVTADMINBUILD=1 build                     
Sat Oct 12 19:20:14 CEST 2024: Building source tree
tim@Tims-MacBook-Pro vitess % ./bin/vttablet --tablet-path test-123456789 --structured-logging 2>&1 | head -3                       
W1012 19:21:23.195690   37283 log.go:39] Failed to read in config : Config File "vtconfig" Not Found in "[/Users/tim/github/slackhq/vitess]". This is optional, and can be ignored if you are not using config files. For a detailed explanation, see https://github.com/vitessio/vitess/blob/main/doc/viper/viper.md#config-files.
{"level":"info","ts":"2024-10-12T19:21:23+02:00","caller":"servenv/servenv_unix.go:66","msg":"Version: 19.0.5 (Git revision 6ba49614d7e25fbbe4fd649113a01fe7b5b13810 branch 'fix-structured-logging_slack-19.0') built on Sat Oct 12 19:20:14 CEST 2024 by tim@Tims-MacBook-Pro.local using go1.22.8 darwin/amd64"}
{"level":"warn","ts":"2024-10-12T19:21:23+02:00","caller":"servenv/http.go:57","msg":"Beginning in v20, pprof-http will default to `false`; to continue enabling pprof endpoints, please manually set this flag before upgrading."}

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
@github-actions github-actions bot added this to the v19.0.5 milestone Oct 12, 2024
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
@timvaillancourt timvaillancourt marked this pull request as ready for review October 12, 2024 17:24
@timvaillancourt timvaillancourt requested a review from a team as a code owner October 12, 2024 17:25
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
@timvaillancourt
Copy link
Member Author

Confirmed this on tablets ✅:

tvaillancourt@tablet-iad-staging-vtfun-00-80-5m9z:/var/log/vttablet$ tail vttablet.log|tail -1 |jq .
{
  "level": "warn",
  "ts": "2024-10-16T08:24:27-07:00",
  "caller": "discovery/healthcheck.go:557",
  "msg": "not marking healthy primary us_east_1e-0170333722 as Up for loadtest/80- because its PrimaryTermStartTime is smaller than the highest known timestamp from previous PRIMARYs us_east_1b-0170353516: 1728945320 < 1728945636 "
}

@timvaillancourt timvaillancourt merged commit 3ead23e into slack-19.0 Oct 17, 2024
161 of 163 checks passed
@timvaillancourt timvaillancourt deleted the fix-structured-logging_slack-19.0 branch October 17, 2024 17:46
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.

2 participants