Skip to content

chore: add CLI invokation telemetry #7589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Record InvokedAt
  • Loading branch information
ammario committed May 16, 2023
commit 672117307cb3a34b0cde1e8418dd08dee5d0b5e1
5 changes: 3 additions & 2 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ func telemetryInvocation(i *clibase.Invocation) telemetry.CLIInvocation {
})
}
return telemetry.CLIInvocation{
Command: i.Command.FullName(),
Options: topts,
Command: i.Command.FullName(),
Options: topts,
InvokedAt: time.Now(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions coderd/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,8 @@ type CLIOption struct {
type CLIInvocation struct {
Command string `json:"command"`
Options []CLIOption `json:"options"`
// InvokedAt is provided for deduplication purposes.
InvokedAt time.Time `json:"invoked_at"`
}

type noopReporter struct{}
Expand Down