databricks-cli/cmd/root/user_agent_command_exec_id.go

15 lines
363 B
Go
Raw Normal View History

2024-10-31 10:16:14 +00:00
package root
import (
"context"
"github.com/databricks/databricks-sdk-go/useragent"
"github.com/google/uuid"
)
func withCommandExecIdInUserAgent(ctx context.Context) context.Context {
2024-10-31 13:48:30 +00:00
// A UUID that will allow us to correlate multiple API requests made by
// the same CLI invocation.
2024-10-31 10:16:14 +00:00
return useragent.InContext(ctx, "cmd-exec-id", uuid.New().String())
}