Skip to content

Commit

Permalink
Merge pull request #5 from cjs/OTEL-env-variables
Browse files Browse the repository at this point in the history
Update OtelTracer respect ENV variables
jzelinskie authored Mar 14, 2022
2 parents 1bd0f89 + 030ba69 commit 73f399c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cobrautil.go
Original file line number Diff line number Diff line change
@@ -232,10 +232,7 @@ func OpenTelemetryRunE(flagPrefix string, prerunLevel zerolog.Level) CobraRunFun
}

func initOtelTracer(exporter trace.SpanExporter, serviceName string, propagators []string) error {
res, _ := resource.Merge(
resource.Default(),
resource.NewSchemaless(semconv.ServiceNameKey.String(serviceName)),
)
res, _ := resource.New(context.Background(), resource.WithAttributes(semconv.ServiceNameKey.String(serviceName)))

tp := trace.NewTracerProvider(
trace.WithSampler(trace.AlwaysSample()),

0 comments on commit 73f399c

Please sign in to comment.