Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(infra): change panic to print #1559

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}
Loading