Skip to content

Commit 317af07

Browse files
committed
Match upstream use of autoexport
1 parent f0aeb33 commit 317af07

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

export/otelsdk/config.go

+3-14
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ const (
2727
// envResourceAttrKey is the key for the environment variable value
2828
// containing OpenTelemetry Resource attributes.
2929
envResourceAttrKey = "OTEL_RESOURCE_ATTRIBUTES"
30-
// envTracesExportersKey is the key for the environment variable value
31-
// containing what OpenTelemetry trace exporter to use.
32-
envTracesExportersKey = "OTEL_TRACES_EXPORTER"
3330
// envLogLevelKey is the key for the environment variable value containing
3431
// the log level.
3532
envLogLevelKey = "OTEL_LOG_LEVEL"
@@ -122,17 +119,9 @@ var (
122119
func WithEnv() Option {
123120
return fnOpt(func(ctx context.Context, c config) (config, error) {
124121
var err error
125-
if _, ok := lookupEnv(envTracesExportersKey); ok {
126-
// Don't track the lookup value because autoexport does not provide
127-
// a way to just pass the environment value currently. Just use
128-
// NewSpanExporter which will re-read this value.
129-
130-
var e error
131-
// NewSpanExporter will use an OTLP (HTTP/protobuf) exporter as the
132-
// default. This is the OTel recommended default.
133-
c.exporter, e = autoexport.NewSpanExporter(ctx)
134-
err = errors.Join(err, e)
135-
}
122+
// NewSpanExporter will use an OTLP (HTTP/protobuf) exporter as the
123+
// default. This is the OTel recommended default.
124+
c.exporter, err = autoexport.NewSpanExporter(ctx)
136125

137126
c.resAttrs = append(c.resAttrs, lookupResourceData()...)
138127

0 commit comments

Comments
 (0)