-
Notifications
You must be signed in to change notification settings - Fork 36
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
Programmatically Environment override doesn't work #43
Comments
We have this test which was intended to demonstrate this, however I believe the issue is actually caused by environment detection kicking off at the time the module is loaded and then getting cached and never re-evaluated. Unfortunately, due to module hoisting the fix isn't as simple as changing the configuration prior to importing the |
@jaredcnance thanks for looking into it. I'm happy that I can override at least with the env variable. Would it be useful to temporarily flag this in the docs by either annotating that it currently doesn't work or temporarily removing the programmatic approach from it? Just so people are aware that in the meantime they have to use the ENV variable, unless the fix is quicker than a doc change of course 😄 |
Yes, that’s a good point. We can remove this from the documentation for now. Updated in #44. |
Thanks @jaredcnance. |
Summary
According to #19 you can now override the environment detection by either using
or
When I export the environment variable it works and I can see the agent logging to stdout, when I try the first approach, I still get the following error:
Details
I've got the following helper module
Environment
The code runs on a Centos7 Docker container
Node: 12.18.0
NPM: 6.14.4
The text was updated successfully, but these errors were encountered: