Skip to content

Commit ef0b3c4

Browse files
authored
Use new error telemetry API (#435)
1 parent ef7ae41 commit ef0b3c4

File tree

20 files changed

+658
-374
lines changed

20 files changed

+658
-374
lines changed

src/operator/controllers/pod_reconcilers/pods.go

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (p *PodWatcher) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
5959
logrus.Debugf("Reconciling due to pod change: %s", req.Name)
6060
pod := v1.Pod{}
6161
err := p.Get(ctx, req.NamespacedName, &pod)
62+
6263
if k8serrors.IsNotFound(err) {
6364
logrus.Debugf("Pod was deleted")
6465
return ctrl.Result{}, nil

src/operator/main.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,16 @@ func main() {
120120
if viper.GetBool(operatorconfig.DebugLogKey) {
121121
logrus.SetLevel(logrus.DebugLevel)
122122
}
123-
errorreporter.Init("intents-operator", version.Version(), viper.GetString(operatorconfig.TelemetryErrorsAPIKeyKey))
123+
124+
signalHandlerCtx := ctrl.SetupSignalHandler()
125+
126+
clusterUID, err := clusterutils.GetOrCreateClusterUID(signalHandlerCtx)
127+
if err != nil {
128+
logrus.WithError(err).Panic("Failed obtaining cluster ID")
129+
}
130+
componentinfo.SetGlobalContextId(telemetrysender.Anonymize(clusterUID))
131+
132+
errorreporter.Init(telemetriesgql.TelemetryComponentTypeIntentsOperator, version.Version())
124133
defer errorreporter.AutoNotify()
125134
shared.RegisterPanicHandlers()
126135

@@ -190,14 +199,6 @@ func main() {
190199
if err != nil {
191200
logrus.WithError(err).Panic(err, "unable to start manager")
192201
}
193-
signalHandlerCtx := ctrl.SetupSignalHandler()
194-
195-
clusterUID, err := clusterutils.GetOrCreateClusterUID(signalHandlerCtx)
196-
if err != nil {
197-
logrus.WithError(err).Panic("Failed obtaining cluster ID")
198-
}
199-
componentinfo.SetGlobalContextId(telemetrysender.Anonymize(clusterUID))
200-
componentinfo.SetGlobalVersion(version.Version())
201202

202203
directClient, err := client.New(ctrl.GetConfigOrDie(), client.Options{Scheme: mgr.GetScheme()})
203204
if err != nil {

src/shared/awsagent/roles.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func (a *Agent) generateTrustPolicy(namespaceName, accountName string) (string,
442442
return "", errors.Wrap(err)
443443
}
444444

445-
return string(serialized), errors.Wrap(err)
445+
return string(serialized), nil
446446
}
447447

448448
func (a *Agent) generateTrustPolicyForRolesAnywhere(namespaceName, accountName string) (string, error) {

src/shared/logrus_bugsnag/logrus.go

-112
This file was deleted.

0 commit comments

Comments
 (0)