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

Log version/build info on startup #4723

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

yurishkuro
Copy link
Member

Which problem is this PR solving?

  • When users ask questions and include logs, it's difficult to tell which version of the binary they are running, especially when they use the latest Docker tag.

Description of the changes

  • Log build / version info on startup in all binaries
  • Move sub-commands into cmd/internal, to not confuse them with the actual binaries

How was this change tested?

$ go run ./cmd/tracegen
2023-09-04T11:24:55.559-0400	INFO	tracegen/main.go:56	application version: git-commit=, git-version=, build-date=

$ go run ./cmd/all-in-one
2023/09/04 11:24:31 application version: git-commit=, git-version=, build-date=

Checklist

@yurishkuro yurishkuro requested a review from a team as a code owner September 4, 2023 15:25
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@codecov
Copy link

codecov bot commented Sep 4, 2023

@yurishkuro yurishkuro merged commit 730584f into jaegertracing:main Sep 4, 2023
@yurishkuro yurishkuro deleted the log-version branch September 4, 2023 15:48
yurishkuro added a commit that referenced this pull request Sep 6, 2023
## Which problem is this PR solving?
- PR #4723 added logging, but tracegen was not built with build-info
embedded

## Description of the changes
-  add build info to tracegen and anonymizer binaries

## How was this change tested?
```
$ make build-tracegen
CGO_ENABLED=0 installsuffix=cgo go build -trimpath -ldflags "-X github.com/jaegertracing/jaeger/pkg/version.commitSHA=f8c1523f64159bf05eedf6aa6ffb09c9402a9932 -X github.com/jaegertracing/jaeger/pkg/version.latestVersion=v1.48.0 -X github.com/jaegertracing/jaeger/pkg/version.date=2023-09-05T00:05:46Z" -o ./cmd/tracegen/tracegen-darwin-amd64 ./cmd/tracegen/main.go

$ ./cmd/tracegen/tracegen-darwin-amd64
2023-09-05T21:55:58.923-0400	INFO	./main.go:56	application version: git-commit=f8c1523f64159bf05eedf6aa6ffb09c9402a9932, git-version=v1.48.0, build-date=2023-09-05T00:05:46Z
```

Signed-off-by: Yuri Shkuro <[email protected]>
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.

1 participant