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 env vars for parity with other agents #104

Closed
novas0x2a opened this issue Sep 19, 2019 · 4 comments
Closed

support env vars for parity with other agents #104

novas0x2a opened this issue Sep 19, 2019 · 4 comments

Comments

@novas0x2a
Copy link

Some of the other language agents support environment-based config (e.g. java, node), would it be possible for this lib to support them too, probably by loading them in NewConfig and only falling back to the current defaults if the vars are unset? Thanks!

@purple4reina
Copy link
Contributor

purple4reina commented Sep 24, 2019

@novas0x2a Thanks a ton for sharing this issue with us! We think this is a great idea. We're in the process now of planning for a 3.0 release in which we are considering something like what you suggest.

Our idea is to simplify the creation of the Application object. Instead of needing to create a Config, then an Application from the Config, you'd use one method to create the Application and pass it a set of options much like we've done in our telemetry-sdk. It would look something like this:

app, err := newrelic.NewApplication("MyAppName", "MyLicenseKey", newrelic.ConfigDistributedTracingEnabled)

One such option we could have would allow reading from environment variables. So, in your case, you'd do something like this:

app, err := newrelic.NewApplication("MyAppName", "MyLicenseKey", newrelic.ConfigFromEnvVar)

Notice that the agent wouldn't read settings from environment variables by default, but you could easily configure it to do so.

What are your thoughts? Would this type of system fit your needs?

@purple4reina
Copy link
Contributor

Hi @novas0x2a!

We've recently published some proposed changes to the agent for a 3.0 major version release #106. We're wondering what you think of these changes and if they will fit your needs.

@novas0x2a
Copy link
Author

This seems fine, yep! They're not listed in the doc, but as long as the env vars match up with the other clients it looks like this would work fine for us (we set the env vars globally, so we're very aware of mismatches like node's NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES vs java's NEW_RELIC_ERROR_COLLECTOR_IGNORE_STATUS_CODES)

@purple4reina
Copy link
Contributor

Hey @novas0x2a!

Thanks again for opening this issue! We just released v3.0.0 of the agent which has support for setting configuration via environment variables. Check it out and let us know what you think! If there's any env vars that you'd like added, just let us know!

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

2 participants