Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Oct 31, 2024
1 parent 941958c commit 9302520
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/root/user_agent_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"strings"

"github.com/databricks/databricks-sdk-go/useragent"
"github.com/google/uuid"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -34,11 +33,5 @@ func commandString(cmd *cobra.Command) string {
}

func withCommandInUserAgent(ctx context.Context, cmd *cobra.Command) context.Context {
// A UUID that'll will allow use to correlate multiple API requests made by
// the same command invocation.
// 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(ctx, "cmd", commandString(cmd))
}

0 comments on commit 9302520

Please sign in to comment.