mirror of https://github.com/databricks/cli.git
This commit is contained in:
parent
c92f7bdf39
commit
821627b08b
|
@ -34,9 +34,11 @@ func commandString(cmd *cobra.Command) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func withCommandInUserAgent(ctx context.Context, cmd *cobra.Command) context.Context {
|
func withCommandInUserAgent(ctx context.Context, cmd *cobra.Command) context.Context {
|
||||||
// We add a uuid to the command context to trace multiple API requests made
|
// A UUID that'll will allow use to correlate multiple API requests made by
|
||||||
// by the same command invocation.
|
// the same command invocation.
|
||||||
newCtx := useragent.InContext(ctx, "cmd-trace-id", uuid.New().String())
|
// When we add telemetry to the CLI, this trace ID will allow allow us to
|
||||||
|
// correlate logs in HTTP access logs with logs in Frontend logs.
|
||||||
|
newCtx := useragent.InContext(ctx, "command-trace-id", uuid.New().String())
|
||||||
|
|
||||||
return useragent.InContext(newCtx, "cmd", commandString(cmd))
|
return useragent.InContext(newCtx, "cmd", commandString(cmd))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue