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

Feature request: span/ metric exporter initialization ignoring environment #5188

Open
rob0rt opened this issue Apr 9, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@rob0rt
Copy link

rob0rt commented Apr 9, 2024

Problem Statement

When deploying to a shared environment, it's possible that the system's environment variables are polluted with other application's OTel configuration that could cause issue during the exporter initialization. For example:

Proposed Solution

  • An entirely new API for otlptracehttp.New or otlpmetrichttp.New (-> NewWithoutEnv) which do not read from the environment
    • Add a new option WithEnvironment, WithDefault?
  • Add an option to the existing API WithoutEnv

Alternatives

Currently the only alternative I've found is to call os.Unsetenv and explicitly remove the polluting environment variables

Prior Art

The resource APIs currently offer a means to initialize without inheriting values from the Environment.

  • resource.Default uses the environment, or when creating a resource explicitly one can use resource.WithFromEnv()

Additional Context

n/a

@rob0rt rob0rt added the enhancement New feature or request label Apr 9, 2024
@MrAlias
Copy link
Contributor

MrAlias commented Apr 9, 2024

If you do not want to use an environment variable, use the os.Unsetenv function.

@rob0rt
Copy link
Author

rob0rt commented Apr 9, 2024

If you do not want to use an environment variable, use the os.Unsetenv function.

I called that out in Alternatives, and is the approach I ended up going with in my application as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants