address comments

This commit is contained in:
Shreyas Goenka 2024-10-31 14:48:30 +01:00
parent bbc2632474
commit a7e54a22d5
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 3 additions and 5 deletions

View File

@ -75,8 +75,8 @@ func New(ctx context.Context) *cobra.Command {
// Configure our user agent with the command that's about to be executed. // Configure our user agent with the command that's about to be executed.
ctx = withCommandInUserAgent(ctx, cmd) ctx = withCommandInUserAgent(ctx, cmd)
ctx = withUpstreamInUserAgent(ctx)
ctx = withCommandExecIdInUserAgent(ctx) ctx = withCommandExecIdInUserAgent(ctx)
ctx = withUpstreamInUserAgent(ctx)
cmd.SetContext(ctx) cmd.SetContext(ctx)
return nil return nil
} }

View File

@ -8,9 +8,7 @@ import (
) )
func withCommandExecIdInUserAgent(ctx context.Context) context.Context { func withCommandExecIdInUserAgent(ctx context.Context) context.Context {
// A UUID that'll will allow use to correlate multiple API requests made by // A UUID that will allow us to correlate multiple API requests made by
// the same command invocation. // the same CLI invocation.
// When we add telemetry to the CLI, this exec ID will allow allow us to
// correlate logs in HTTP access logs with logs in Frontend logs.
return useragent.InContext(ctx, "cmd-exec-id", uuid.New().String()) return useragent.InContext(ctx, "cmd-exec-id", uuid.New().String())
} }