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

Support the OTEL_TRACES_EXPORTER environment variable #2310

Closed
MrAlias opened this issue Oct 19, 2021 · 8 comments
Closed

Support the OTEL_TRACES_EXPORTER environment variable #2310

MrAlias opened this issue Oct 19, 2021 · 8 comments
Assignees
Labels
area:trace Part of OpenTelemetry tracing enhancement New feature or request pkg:exporter:otlp Related to the OTLP exporter package pkg:exporter:stdout Related to the stdout exporter package pkg:exporter:zipkin Related to the Zipkin exporter package pkg:SDK Related to an SDK package

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Oct 19, 2021

Add support for the OTEL_TRACES_EXPORTER environment variable as defined in the specification.

This will require designing and ratifying a plan to support loading all the exporters we need without having the SDK import them all. As was mentioned here we could look at the https://pkg.go.dev/plugin package. Or, as was suggested in a SIG meeting, look into maybe some registration method similar to the database/sql package.

It might also be the case that we do not want to ultimately support this. Part of this issue is determining the feasibility and appropriateness of this configuration option.

Part of #1698

@MrAlias MrAlias added the pkg:SDK Related to an SDK package label Oct 19, 2021
@MovieStoreGuy
Copy link

@MrAlias , moving to the https://pkg.go.dev/plugin requires that applications ship with cgo enabled since it depends on the c method dlopen. This could be problematic for services that ship a static binary into their production environment. I believe this to be the common case for most golang based applications.

Is it permissible to have environment variable defined, but only consumed if the application developer adds in the exporter explicitly?

for example:

import (
     otel/sdk
     otel/exporter
     _ otel/exporter/zipkin // registering global init method to allow for zipkin exporter
)

// Carrying on, start the SDK and have a valid, configured zipkin exporter
import (
    otel/sdk
    otel/exporter
    _ otel/exporter/otlp
)

// zipkin var is present but no zipkin exporter configured

@pellared
Copy link
Member

look into maybe some registration method similar to the database/sql package

I see it as the best approach as

  1. it does not force any dependencies
  2. it gives the possibility to select the propagators that are supported by the application
  3. it allows also building a convenience module/package that will contain the propagators that should be supported by the spec (tracecontext and baggage)
  4. I find it good when we can reuse a pattern used in the standard library

https://pkg.go.dev/plugin is rather a no-go as it does even not work on all platforms. I find it also not suitable for this use case.

FYI this is something I plan to do in .NET SDK: open-telemetry/opentelemetry-dotnet#1453 (comment)

@MovieStoreGuy
Copy link

MovieStoreGuy commented Oct 20, 2021

I know myself and few others have toyed with idea of connivence libs to effectively meet the same goal.

An example to help get me get started quicker is https://github.com/MovieStoreGuy/otel-go-starter/tree/main.

it does not force any dependencies

Just to double check what you mean, are you meaning that there is no tightly coupled code inside the sdk?
Or that we should only include the required exporter code (say .../pkg/zipkin) when explicitly asked to?

@pellared
Copy link
Member

I mean "we should only include the required exporter code (say .../pkg/zipkin) when explicitly asked to".

@MrAlias
Copy link
Contributor Author

MrAlias commented Oct 20, 2022

Should be resolved by open-telemetry/opentelemetry-go-contrib#2753

@pellared pellared self-assigned this Oct 16, 2023
@pellared
Copy link
Member

I think that the env var should be supported by the SDK (sdk/trace package).

Reference: open-telemetry/opentelemetry-specification#3721 (comment)

@pellared pellared added area:trace Part of OpenTelemetry tracing pkg:exporter:otlp Related to the OTLP exporter package pkg:exporter:stdout Related to the stdout exporter package pkg:exporter:jaeger Related to the Jaeger exporter package pkg:exporter:zipkin Related to the Zipkin exporter package enhancement New feature or request and removed pkg:exporter:jaeger Related to the Jaeger exporter package labels Oct 16, 2023
@pellared
Copy link
Member

@pellared pellared added blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made and removed blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made labels Oct 27, 2023
@pellared
Copy link
Member

@pellared pellared closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:trace Part of OpenTelemetry tracing enhancement New feature or request pkg:exporter:otlp Related to the OTLP exporter package pkg:exporter:stdout Related to the stdout exporter package pkg:exporter:zipkin Related to the Zipkin exporter package pkg:SDK Related to an SDK package
Projects
None yet
Development

No branches or pull requests

3 participants