Merge pull request #1757 from aluzzardi/telemetry-log-duration
telemetry: log duration
This commit is contained in:
commit
26fe2630b5
@ -98,6 +98,7 @@ func Track(ctx context.Context, eventName string, properties ...*Property) {
|
|||||||
"Accept": {"*/*"},
|
"Accept": {"*/*"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start := time.Now()
|
||||||
resp, err := http.DefaultClient.Do(req)
|
resp, err := http.DefaultClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lg.Trace().Err(err).Msg("failed to send telemetry event")
|
lg.Trace().Err(err).Msg("failed to send telemetry event")
|
||||||
@ -110,7 +111,7 @@ func Track(ctx context.Context, eventName string, properties ...*Property) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
lg.Trace().Msg("telemetry event")
|
lg.Trace().Dur("duration", time.Since(start)).Msg("telemetry event")
|
||||||
}
|
}
|
||||||
|
|
||||||
type payload struct {
|
type payload struct {
|
||||||
|
Reference in New Issue
Block a user