Skip to content

Commit

Permalink
ING-876: Fixed potential panic due to nil tracer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett Lawson authored and brett19 committed Aug 8, 2024
1 parent ba823f8 commit 17eb567
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmd/gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ import (
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/exporters/prometheus"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
Expand Down Expand Up @@ -105,8 +103,8 @@ func initTelemetry(
enableMetrics bool,
traceEverything bool,
) (
trace.TracerProvider,
metric.MeterProvider,
*sdktrace.TracerProvider,
*sdkmetric.MeterProvider,
error,
) {
res, err := resource.New(ctx,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ require (
go.opentelemetry.io/otel/metric v1.28.0
go.opentelemetry.io/otel/sdk v1.28.0
go.opentelemetry.io/otel/sdk/metric v1.28.0
go.opentelemetry.io/otel/trace v1.28.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240716175740-e3f259677ff7
golang.org/x/mod v0.19.0
Expand Down Expand Up @@ -82,6 +81,7 @@ require (
github.com/spf13/cast v1.6.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
Expand Down

0 comments on commit 17eb567

Please sign in to comment.