Skip to content

Commit

Permalink
Debug vars: Expose build version in /debug/vars (#14713)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Coleman <[email protected]>
  • Loading branch information
tycol7 authored Dec 11, 2023
1 parent b91fb88 commit 48a60d8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
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")

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

0 comments on commit 48a60d8

Please sign in to comment.