Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version: add Go build tags to output #455

Merged
merged 1 commit into from Mar 6, 2023

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

None yet

3 participants