HomePhabricator

Report build meta data
c2dcf59c7287Unpublished

Authored by Eevans on Jul 1 2019, 7:11 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Report build meta data

Introduces variables (scoped main) for a version, git hash, and build host and
date. These values are passed in at compile-time via the -ldflags argument
from the Makefile.

This build metadata, along with the Go version (ala runtime.Version()), is
both logged at startup, and returned as JSON in /healthz responses.

Finally, a dummy Prometheus gauge (kask_build_information) is exported with
the above metadata as labels, allowing series selection on one or more of these
values (see:
https://www.robustperception.io/exposing-the-software-version-to-prometheus).

NOTE: This change makes Git a build dependency.

Bug: T226988
Change-Id: I18256953fb68e52850eb3bc19b5bc0be29be65a6