From 0a61fb58bd11bbf8498aae3359d50b9345d82bb8 Mon Sep 17 00:00:00 2001 From: Goathoon Date: Thu, 14 Mar 2024 12:20:13 +0000 Subject: [PATCH] fix(infra): change panic to print --- apps/iris/src/observability/metric.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/iris/src/observability/metric.go b/apps/iris/src/observability/metric.go index a88e6c17cc..e6e5e9a8db 100644 --- a/apps/iris/src/observability/metric.go +++ b/apps/iris/src/observability/metric.go @@ -21,7 +21,7 @@ func SetGlobalMeterProvider() { // Create resource. res, err := newMetricResource() if err != nil { - panic(err) + reportErr(err, "failed to create metric resource") } // Create a meter provider. @@ -29,7 +29,7 @@ func SetGlobalMeterProvider() { // accepts a MeterProvider instance. meterProvider, err := newMeterProvider(res, defaultMetricDuration) if err != nil { - panic(err) + reportErr(err, "failed to create metric provider") } // Register as global meter provider so that it can be used via otel.Meter @@ -80,7 +80,7 @@ func GetMemoryMeter(meter metric.Meter) { return nil }), ); err != nil { - panic(err) + reportErr(err, "failed to create memory meter") } } @@ -102,6 +102,6 @@ func GetCPUMeter(meter metric.Meter, duration time.Duration) { return nil }), ); err != nil { - panic(err) + reportErr(err, "failed to create CPU meter") } }