chore: add CLI invokation telemetry (#7589)

This commit is contained in:
Ammar Bandukwala
2023-05-24 11:08:03 -05:00
committed by GitHub
parent b6604e8845
commit ec117e841a
7 changed files with 163 additions and 14 deletions
+13
View File
@@ -701,6 +701,7 @@ type Snapshot struct {
WorkspaceBuilds []WorkspaceBuild `json:"workspace_build"`
WorkspaceResources []WorkspaceResource `json:"workspace_resources"`
WorkspaceResourceMetadata []WorkspaceResourceMetadata `json:"workspace_resource_metadata"`
CLIInvocations []CLIInvocation `json:"cli_invocations"`
}
// Deployment contains information about the host running Coder.
@@ -876,6 +877,18 @@ type License struct {
UUID uuid.UUID `json:"uuid"`
}
type CLIOption struct {
Name string `json:"name"`
ValueSource string `json:"value_source"`
}
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{}
func (*noopReporter) Report(_ *Snapshot) {}