MCPcopy Index your code
hub / github.com/docker/docker-agent / TrackCommand

Function TrackCommand

pkg/telemetry/global.go:10–22  ·  view source on GitHub ↗

TrackCommand records a command event using automatic telemetry initialization

(ctx context.Context, action string, args []string)

Source from the content-addressed store, hash-verified

8
9// TrackCommand records a command event using automatic telemetry initialization
10func TrackCommand(ctx context.Context, action string, args []string) {
11 // Automatically initialize telemetry if not already done
12 EnsureGlobalTelemetryInitialized(ctx)
13
14 if globalToolTelemetryClient != nil {
15 commandEvent := CommandEvent{
16 Action: action,
17 Args: args,
18 Success: true, // We're tracking user intent, not outcome
19 }
20 globalToolTelemetryClient.Track(ctx, &commandEvent)
21 }
22}
23
24// TrackCommandError records a command eventerror, send telemetry synchronously to ensure it is sent before the process exits after error
25// do nothing if err == nil

Callers 15

runPushCommandFunction · 0.92
runAPICommandMethod · 0.92
runACPCommandMethod · 0.92
runNewCommandMethod · 0.92
newGettingStartedCmdFunction · 0.92
newDebugAuthCmdFunction · 0.92
runDebugConfigCommandMethod · 0.92
runDebugSkillsCommandMethod · 0.92
runDebugTitleCommandMethod · 0.92
runModelsListCommandMethod · 0.92
runAliasAddCommandFunction · 0.92

Calls 2

TrackMethod · 0.45

Tested by 1