Skip to content

Build info metric

Mikhail Mazurskiy requested to merge ash2k/build-info into master
➜  gitlab-agent git:(ash2k/build-info) ✗ make kas
go build \
                -tags "tracer_static,tracer_static_jaeger" \
                -ldflags "-X gitlab.com/gitlab-org/cluster-integration/gitlab-agent/cmd.Version="v0.0.0" -X gitlab.com/gitlab-org/cluster-integration/gitlab-agent/cmd.Commit=ca70ee9 -X gitlab.com/gitlab-org/cluster-integration/gitlab-agent/cmd.BuildTime=20210113.004301" \
                -o "" ./cmd/kas
➜  gitlab-agent git:(ash2k/build-info) ✗ ./kas --version  
kas version: v0.0.0, commit: ca70ee9, built: 20210113.004301
➜  gitlab-agent git:(master) ✗ bazel run //cmd/kas -- --version
DEBUG: /private/var/tmp/_bazel_mikhail/6a0c1de97b81a8c5de5b6b9aec394679/external/rules_python/python/legacy_pip_import/pip.bzl:143:10: DEPRECATED: the pip_import rule has been replaced with pip_install, please see rules_python 0.1 release notes
INFO: Analyzed target //cmd/kas:kas (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //cmd/kas:kas up-to-date:
  /private/var/tmp/_bazel_mikhail/6a0c1de97b81a8c5de5b6b9aec394679/execroot/gitlab_k8s_agent/bazel-out/darwin-fastbuild/bin/cmd/kas/kas_/kas
INFO: Elapsed time: 0.744s, Critical Path: 0.06s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
kas version: v0.0.0, commit: ca70ee9, built: 20210113.003857

Via HTTP (it's empty because my Goland is not setup to set linker flags):

# HELP gitlab_build_info Current build info for this GitLab Service
# TYPE gitlab_build_info gauge
gitlab_build_info{built="00000000.000000",version="v0.0.0"} 1

Merge request reports