-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
telemetry.go
90 lines (71 loc) · 1.64 KB
/
telemetry.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//go:build telemetry
// +build telemetry
package main
import "github.com/open-sauced/pizza-cli/v2/pkg/utils"
// This alternate main is used as a one-shot for bootstrapping Posthog events:
// the various events called herein do not exist in Posthog's datalake until the
// event has landed.
//
// Therefore, this is useful for when there are new events for Posthog that need
// a dashboard bootstrapped for them.
func main() {
println("Started bootstrapping Posthog events")
client := utils.NewPosthogCliClient(true)
err := client.CaptureLogin("test-user")
if err != nil {
panic(err)
}
err = client.CaptureFailedLogin()
if err != nil {
panic(err)
}
err = client.CaptureCodeownersGenerate()
if err != nil {
panic(err)
}
err = client.CaptureFailedCodeownersGenerate()
if err != nil {
panic(err)
}
err = client.CaptureConfigGenerate()
if err != nil {
panic(err)
}
err = client.CaptureFailedConfigGenerate()
if err != nil {
panic(err)
}
err = client.CaptureConfigGenerateMode("interactive")
if err != nil {
panic(err)
}
err = client.CaptureCodeownersGenerateAuth("test-user")
if err != nil {
panic(err)
}
err = client.CaptureFailedCodeownersGenerateAuth()
if err != nil {
panic(err)
}
err = client.CaptureCodeownersGenerateContributorInsight()
if err != nil {
panic(err)
}
err = client.CaptureFailedCodeownersGenerateContributorInsight()
if err != nil {
panic(err)
}
err = client.CaptureInsights()
if err != nil {
panic(err)
}
err = client.CaptureFailedInsights()
if err != nil {
panic(err)
}
err = client.Done()
if err != nil {
panic(err)
}
println("Done bootstrapping Posthog events")
}