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

Debug vars: Expose build version in /debug/vars #14713

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/19.0/19.0.0/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [New MySQL Image](#mysql-image)
- **[New Stats](#new-stats)**
- [Stream Consolidations](#stream-consolidations)
- [Build Version in `/debug/vars`](#build-version-in-debug-vars)
- **[VTGate](#vtgate)**
- [`FOREIGN_KEY_CHECKS` is now a Vitess Aware Variable](#fk-checks-vitess-aware)
- **[Vttestserver](#vttestserver)**
Expand Down Expand Up @@ -53,6 +54,10 @@ Several tags are available to let you choose what version of MySQL you want to u

Prior to 19.0 VTTablet reported how much time non-streaming executions spend waiting for consolidations to occur. In 19.0, VTTablet reports a similar stat for streaming executions in `/debug/vars` stat `Waits.Histograms.StreamConsolidations`.

#### <a id="build-version-in-debug-vars"/>Build Version in `/debug/vars`

The build version (e.g., `19.0.0-SNAPSHOT`) has been added to `/debug/vars`, allowing users to programmatically inspect Vitess components' build version at runtime.

### <a id="vtgate"/>VTGate

#### <a id="fk-checks-vitess-aware"/>`FOREIGN_KEY_CHECKS` is now a Vitess Aware Variable
Expand Down
3 changes: 3 additions & 0 deletions go/vt/servenv/buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var (
buildTime = ""
buildGitRev = ""
buildGitBranch = ""
statsBuildVersion *stats.String
jenkinsBuildNumberStr = ""

// version registers the command line flag to expose build info.
Expand Down Expand Up @@ -121,6 +122,8 @@ func init() {
stats.NewString("BuildHost").Set(AppVersion.buildHost)
stats.NewString("BuildUser").Set(AppVersion.buildUser)
stats.NewGauge("BuildTimestamp", "build timestamp").Set(AppVersion.buildTime)
statsBuildVersion = stats.NewString("BuildVersion")
statsBuildVersion.Set(AppVersion.version)
stats.NewString("BuildGitRev").Set(AppVersion.buildGitRev)
stats.NewString("BuildGitBranch").Set(AppVersion.buildGitBranch)
stats.NewGauge("BuildNumber", "build number").Set(AppVersion.jenkinsBuildNumber)
Expand Down
5 changes: 5 additions & 0 deletions go/vt/servenv/buildinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ func TestVersionString(t *testing.T) {

assert.Equal(t, "8.0.30-Vitess", v.MySQLVersion())
}

func TestBuildVersionStats(t *testing.T) {
buildVersion := statsBuildVersion.Get()
assert.Equal(t, buildVersion, versionName)
}
2 changes: 1 addition & 1 deletion go/vt/vtgate/vtgate.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ var (
vstreamSkewDelayCount = stats.NewCounter("VStreamEventsDelayedBySkewAlignment",
"Number of events that had to wait because the skew across shards was too high")

vindexUnknownParams = stats.NewGauge("VindexUnknownParameters", "Number of parameterss unrecognized by Vindexes")
vindexUnknownParams = stats.NewGauge("VindexUnknownParameters", "Number of parameters unrecognized by Vindexes")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol thank you


timings = stats.NewMultiTimings(
"VtgateApi",
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##Github CI Workflows
## Github CI Workflows

This document has a short outline of how tests are run in CI, how to add new tests and where these are configured.

Expand Down
1 change: 1 addition & 0 deletions web/vtadmin/src/util/tabletDebugVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type TabletDebugVars = Partial<{
BuildNumber: string;
BuildTimestamp: string;
BuildUser: string;
BuildVersion: string;

QPS: { [k: string]: number[] };

Expand Down
Loading