Problem
When troubleshooting a deployed instance, it's currently difficult to know exactly which Git commit or version is running.
Proposed Solution
Use ldflags during the build process to inject the Version, Commit Hash, and Build Time into the binary. Expose this data via a public /version API endpoint and include it in the initial startup logs.
Current Status
- ✅ ldflags injection shipped.
Makefile defines VERSION_LDFLAGS := -X main.Version=$(VERSION) -X main.GitCommit=$(COMMIT) -X main.BuildTime=$(BUILD_TIME) and applies it on every build target (debug, release, cover). cmd/wavehouse/main.go logs the three values at startup (logger.Info("starting WaveHouse", "version", Version, "build_time", BuildTime, "git_commit", GitCommit)).
- ❌
/version HTTP endpoint not shipped. Remaining work.
Alternatives Considered
None
Additional Context
For the endpoint, recommend returning a small JSON document with version, git_commit, build_time, and (optionally) go_version from runtime.Version(). Wire it into the router alongside the existing health endpoints; no auth gate (the values are non-sensitive and already in logs).
Problem
When troubleshooting a deployed instance, it's currently difficult to know exactly which Git commit or version is running.
Proposed Solution
Use ldflags during the build process to inject the Version, Commit Hash, and Build Time into the binary. Expose this data via a public /version API endpoint and include it in the initial startup logs.
Current Status
MakefiledefinesVERSION_LDFLAGS := -X main.Version=$(VERSION) -X main.GitCommit=$(COMMIT) -X main.BuildTime=$(BUILD_TIME)and applies it on every build target (debug, release, cover).cmd/wavehouse/main.gologs the three values at startup (logger.Info("starting WaveHouse", "version", Version, "build_time", BuildTime, "git_commit", GitCommit))./versionHTTP endpoint not shipped. Remaining work.Alternatives Considered
None
Additional Context
For the endpoint, recommend returning a small JSON document with
version,git_commit,build_time, and (optionally)go_versionfromruntime.Version(). Wire it into the router alongside the existing health endpoints; no auth gate (the values are non-sensitive and already in logs).