Skip to content

Build Info & /version Endpoint #44

Description

@taitelee

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/apiHTTP handlers, routing, middlewarearea/observabilityMetrics, logs, traces, health, profilingdocumentationImprovements or additions to documentationenhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions