Skip to content

Commit

Permalink
Capture a cleaner service version
Browse files Browse the repository at this point in the history
This means that we get either the SHA of of the commit, or the tag, rather than the somewhat confusing `heads/main-0-gd4c5dc9` that we get at the moment. This is especially confusing since the SHA is the 7 digits, not 8 (i.e. `d4c5dc9` not `gd4c5dc9`)
  • Loading branch information
dylanratcliffe committed Aug 6, 2024
1 parent 3c3170d commit 92c095b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
)

//go:generate sh -c "echo -n $(git describe --tags --long --all) > commit.txt"
//go:generate sh -c "echo -n $(git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD) > commit.txt"
//go:embed commit.txt
var ServiceVersion string

Expand Down

0 comments on commit 92c095b

Please sign in to comment.