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

Cannot skip setting variable LS_ACCESS_TOKEN when using the launcher locally #27

Open
obax opened this issue Nov 18, 2020 · 0 comments
Open

Comments

@obax
Copy link

obax commented Nov 18, 2020

Is your feature request related to a problem? Please describe.

I would like to disable the instrumentation when running the app locally, but since my code depends on the successful initialisation of the SDK I would need a way to force a pass through even when the required configuration is not met.

Omitting the env var currently triggers this exception:

Invalid configuration: access token missing, must be set when reporting to https://ingest.lightstep.com:443/api/v2/otel/trace. Set LS_ACCESS_TOKEN env var or configure token in code
LightstepConfigurationError: Invalid configuration: access token missing, must be set when reporting to https://ingest.lightstep.com:443/api/v2/otel/trace. Set LS_ACCESS_TOKEN env var or configure token in code

There is no obvious way to disable the instrumentation when those flags aren't set, or at least skipping initialization.

Describe the solution you'd like

I would like to see a flag named "skipInit" / "ignoreInvalid" (since the issue comes from validateConfiguration(config)) in the NodeSDKConfiguration so that I can explicitly define this behaviour depending on the environment I am currently in.

Describe alternatives you've considered
An inelegant alternative would be to for my code to verify if the environment variable exists and create the same initialisation code without the launcher.

Edit:
It looks like setting spanEndpoint: null works.

@obax obax changed the title The absence of the environment variable LS_ACCESS_TOKEN throws an exception Cannot skip setting variable LS_ACCESS_TOKEN when using the launcher locally Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant