Expose build metadata for debugging deploys

14956
0

When you’re on call, you eventually ask: “what version is running?” I expose a tiny /version endpoint that returns build metadata derived from debug.ReadBuildInfo plus a few variables set at build time. The goal isn’t perfect SBOMs; it’s fast debugging: you can confirm commit SHA, module versions, and Go version without SSHing into anything. I like to include this info in logs at startup too, but the endpoint is useful for automation and for health-check dashboards. The key is to keep it non-sensitive: don’t include secrets or internal URLs. In production, I usually guard it behind internal auth or only expose it on an admin listener. This is a low-effort, high-value observability feature.