Skip to content

version: add Go build tags to output#455

Merged
roidelapluie merged 1 commit intoprometheus:mainfrom
bboreham:build-tags
Mar 6, 2023
Merged

version: add Go build tags to output#455
roidelapluie merged 1 commit intoprometheus:mainfrom
bboreham:build-tags

Conversation

@bboreham
Copy link
Member

Build tags allow different implementations of code sections to be included in the binary, so can be important to understand the exact behaviour expected at runtime.

This change includes build tags at the end of the BuildContext string, and as an extra label on the info metric.

Example output when linked into Prometheus:

ts=2023-02-24T11:33:59.355Z caller=main.go:561 level=info build_context="(go=go1.19.3, platform=linux/amd64, user=vagrant@vagrant, date=20230224-11:12:08, tags=netgo,builtinassets,stringlabels)"

Build tags allow different implementations of code sections to be
included in the binary, so can be important to understand the exact
behaviour expected at runtime.

This change includes build tags at the end of the `BuildContext` string,
and as an extra label on the info metric.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@SuperQ SuperQ requested a review from roidelapluie February 25, 2023 10:28
func computeRevision() (string, string) {
var (
rev = "unknown"
tags = "unknown"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be none if we're building with no tags?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with unknown, maybe this can be removed by the compiler? let's proceed as is.

@roidelapluie roidelapluie merged commit 6a5f4db into prometheus:main Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants