File tree 3 files changed +17
-5
lines changed
3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ func main() {
57
57
58
58
setupLog .Info ("starting handler" )
59
59
60
- telemetryClient , _ := telemetry .NewClient (getEnvBool ("DISABLE_TELEMETRY" ))
60
+ telemetryClient , _ := telemetry .NewClient (getEnvBool ("DISABLE_TELEMETRY" ), setupLog )
61
61
telemetryClient .InstanceStart ()
62
62
63
63
k8sClient , err := k8sclient .New ()
Original file line number Diff line number Diff line change @@ -11,15 +11,21 @@ type Client interface {
11
11
InstanceStart ()
12
12
}
13
13
14
+ type logger interface {
15
+ Info (string , ... any )
16
+ Error (error , string , ... any )
17
+ }
18
+
14
19
type EnqueueClient struct {
15
20
client posthog.Client
16
21
distinctID string
17
22
}
18
23
19
24
type MockClient struct {}
20
25
21
- func NewClient (disable bool ) (Client , error ) {
26
+ func NewClient (disable bool , logger logger ) (Client , error ) {
22
27
if disable {
28
+ logger .Info ("telemetry disabled" )
23
29
return MockClient {}, nil
24
30
}
25
31
@@ -30,17 +36,23 @@ func NewClient(disable bool) (Client, error) {
30
36
},
31
37
)
32
38
if err != nil {
39
+ logger .Error (err , "error starting telemetry" )
33
40
return nil , err
34
41
}
35
42
36
43
id , err := uuid .NewUUID ()
37
44
if err != nil {
45
+ logger .Error (err , "error creating UUID" )
38
46
return nil , err
39
47
}
40
48
49
+ idStr := id .String ()
50
+
51
+ logger .Info ("starting instance with UUID" , "UUID" , idStr )
52
+
41
53
return EnqueueClient {
42
54
client : client ,
43
- distinctID : id . String () ,
55
+ distinctID : idStr ,
44
56
}, nil
45
57
}
46
58
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ spec:
333
333
spec :
334
334
containers :
335
335
- name : cyclops-ui
336
- image : cyclopsui/cyclops-ui:v0.2.0
336
+ image : cyclopsui/cyclops-ui:v0.2.1-logging
337
337
ports :
338
338
- containerPort : 80
339
339
env :
@@ -379,7 +379,7 @@ spec:
379
379
serviceAccountName : cyclops-ctrl
380
380
containers :
381
381
- name : cyclops-ctrl
382
- image : cyclopsui/cyclops-ctrl:v0.2.0
382
+ image : cyclopsui/cyclops-ctrl:v0.2.1-logging
383
383
ports :
384
384
- containerPort : 8080
385
385
env :
You can’t perform that action at this time.
0 commit comments