Skip to content

Commit

Permalink
reforamts init otel
Browse files Browse the repository at this point in the history
  • Loading branch information
afzal442 committed Jul 2, 2023
1 parent 0305052 commit 5097b67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/hotrod/pkg/tracing/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ import (
var once sync.Once

// InitOTEL initializes OpenTelemetry SDK.
func InitOTEL(serviceName string, exporterType string, metricsFactory metrics.Factory, logger log.Factory) trace.Tracer {
func InitOTEL(serviceName string, exporterType string, metricsFactory metrics.Factory, logger log.Factory) trace.TracerProvider {
_, oteltp := initBOTH(serviceName, exporterType, metricsFactory, logger)

logger.Bg().Debug("Created OTEL tracer", zap.String("service-name", serviceName))
return oteltp.Tracer(serviceName)
return oteltp
}

// Init returns OTel-OpenTracing Bridge.
Expand Down
3 changes: 2 additions & 1 deletion examples/hotrod/services/driver/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ type Redis struct {
}

func newRedis(otelExporter string, metricsFactory metrics.Factory, logger log.Factory) *Redis {
tp := tracing.InitOTEL("redis-manual", otelExporter, metricsFactory, logger)
return &Redis{
tracer: tracing.InitOTEL("redis-manual", otelExporter, metricsFactory, logger),
tracer: tp.Tracer("redis-manual"),
logger: logger,
}
}
Expand Down

0 comments on commit 5097b67

Please sign in to comment.