Skip to content

Commit

Permalink
fix(infra): change panic to print (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
goathoon authored Mar 14, 2024
1 parent 46395a6 commit cf9accf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/iris/src/observability/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ func SetGlobalMeterProvider() {
// Create resource.
res, err := newMetricResource()
if err != nil {
panic(err)
reportErr(err, "failed to create metric resource")
}

// Create a meter provider.
// You can pass this instance directly to your instrumented code if it
// 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
Expand Down Expand Up @@ -80,7 +80,7 @@ func GetMemoryMeter(meter metric.Meter) {
return nil
}),
); err != nil {
panic(err)
reportErr(err, "failed to create memory meter")
}
}

Expand All @@ -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")
}
}

0 comments on commit cf9accf

Please sign in to comment.