Compare commits
4 Commits
58ae783bf0
...
1d987d238d
Author | SHA1 | Date | |
---|---|---|---|
1d987d238d | |||
3be012e780 | |||
59eaef2ae3 | |||
ddd21b39a6 |
|
@ -38,9 +38,11 @@ func initMetrics(ctx context.Context, name string) (context.Context, func() erro
|
||||||
goversion := ""
|
goversion := ""
|
||||||
pkg := ""
|
pkg := ""
|
||||||
host := ""
|
host := ""
|
||||||
|
version := "0.0.1"
|
||||||
if info, ok := debug.ReadBuildInfo(); ok {
|
if info, ok := debug.ReadBuildInfo(); ok {
|
||||||
goversion = info.GoVersion
|
goversion = info.GoVersion
|
||||||
pkg = info.Path
|
pkg = info.Path
|
||||||
|
version = info.Main.Version
|
||||||
}
|
}
|
||||||
if h, err := os.Hostname(); err == nil {
|
if h, err := os.Hostname(); err == nil {
|
||||||
host = h
|
host = h
|
||||||
|
@ -69,7 +71,7 @@ func initMetrics(ctx context.Context, name string) (context.Context, func() erro
|
||||||
)
|
)
|
||||||
|
|
||||||
meter := provider.Meter(name,
|
meter := provider.Meter(name,
|
||||||
api.WithInstrumentationVersion("0.0.1"),
|
api.WithInstrumentationVersion(version),
|
||||||
api.WithInstrumentationAttributes(
|
api.WithInstrumentationAttributes(
|
||||||
attribute.String("app", name),
|
attribute.String("app", name),
|
||||||
attribute.String("host", host),
|
attribute.String("host", host),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user