Skip to content

Commit

Permalink
telemetry: log duration
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
  • Loading branch information
aluzzardi committed Mar 10, 2022
1 parent c82bc00 commit 3679c04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion telemetry/telemetry.go
Expand Up @@ -98,6 +98,7 @@ func Track(ctx context.Context, eventName string, properties ...*Property) {
"Accept": {"*/*"},
}

start := time.Now()
resp, err := http.DefaultClient.Do(req)
if err != nil {
lg.Trace().Err(err).Msg("failed to send telemetry event")
Expand All @@ -110,7 +111,7 @@ func Track(ctx context.Context, eventName string, properties ...*Property) {
return
}

lg.Trace().Msg("telemetry event")
lg.Trace().Dur("duration", time.Since(start)).Msg("telemetry event")
}

type payload struct {
Expand Down

0 comments on commit 3679c04

Please sign in to comment.