Skip to content

Commit ff40d03

Browse files
tycol7ejortegau
authored andcommitted
Debug vars: Expose build version in /debug/vars (vitessio#14713)
Signed-off-by: Tyler Coleman <tyler@planetscale.com>
1 parent 76081ef commit ff40d03

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

changelog/19.0/19.0.0/summary.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [New MySQL Image](#mysql-image)
1111
- **[New Stats](#new-stats)**
1212
- [Stream Consolidations](#stream-consolidations)
13+
- [Build Version in `/debug/vars`](#build-version-in-debug-vars)
1314
- **[VTGate](#vtgate)**
1415
- [`FOREIGN_KEY_CHECKS` is now a Vitess Aware Variable](#fk-checks-vitess-aware)
1516
- **[Vttestserver](#vttestserver)**
@@ -53,6 +54,10 @@ Several tags are available to let you choose what version of MySQL you want to u
5354

5455
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`.
5556

57+
#### <a id="build-version-in-debug-vars"/>Build Version in `/debug/vars`
58+
59+
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.
60+
5661
### <a id="vtgate"/>VTGate
5762

5863
#### <a id="fk-checks-vitess-aware"/>`FOREIGN_KEY_CHECKS` is now a Vitess Aware Variable

go/vt/servenv/buildinfo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
buildTime = ""
3434
buildGitRev = ""
3535
buildGitBranch = ""
36+
statsBuildVersion *stats.String
3637
jenkinsBuildNumberStr = ""
3738

3839
// version registers the command line flag to expose build info.
@@ -121,6 +122,8 @@ func init() {
121122
stats.NewString("BuildHost").Set(AppVersion.buildHost)
122123
stats.NewString("BuildUser").Set(AppVersion.buildUser)
123124
stats.NewGauge("BuildTimestamp", "build timestamp").Set(AppVersion.buildTime)
125+
statsBuildVersion = stats.NewString("BuildVersion")
126+
statsBuildVersion.Set(AppVersion.version)
124127
stats.NewString("BuildGitRev").Set(AppVersion.buildGitRev)
125128
stats.NewString("BuildGitBranch").Set(AppVersion.buildGitBranch)
126129
stats.NewGauge("BuildNumber", "build number").Set(AppVersion.jenkinsBuildNumber)

go/vt/servenv/buildinfo_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,8 @@ func TestVersionString(t *testing.T) {
4747

4848
assert.Equal(t, "8.0.30-Vitess", v.MySQLVersion())
4949
}
50+
51+
func TestBuildVersionStats(t *testing.T) {
52+
buildVersion := statsBuildVersion.Get()
53+
assert.Equal(t, buildVersion, versionName)
54+
}

go/vt/vtgate/vtgate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ var (
190190
vstreamSkewDelayCount = stats.NewCounter("VStreamEventsDelayedBySkewAlignment",
191191
"Number of events that had to wait because the skew across shards was too high")
192192

193-
vindexUnknownParams = stats.NewGauge("VindexUnknownParameters", "Number of parameterss unrecognized by Vindexes")
193+
vindexUnknownParams = stats.NewGauge("VindexUnknownParameters", "Number of parameters unrecognized by Vindexes")
194194

195195
timings = stats.NewMultiTimings(
196196
"VtgateApi",

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
##Github CI Workflows
1+
## Github CI Workflows
22

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

web/vtadmin/src/util/tabletDebugVars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type TabletDebugVars = Partial<{
3333
BuildNumber: string;
3434
BuildTimestamp: string;
3535
BuildUser: string;
36+
BuildVersion: string;
3637

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

0 commit comments

Comments
 (0)