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

configure via environment variables #969

Open
Jimbolino opened this issue Oct 4, 2024 · 1 comment
Open

configure via environment variables #969

Jimbolino opened this issue Oct 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Jimbolino
Copy link

Summary

In our current setup we build a docker image that includes the newrelic-php-agent. The same docker image is deployed to different environments (testing, staging, production)
During the docker build stage, we write a newrelic.appname to the newrelic.ini file, this works, but we would like to add a variable from the environment to this, so we can more easily differentiate between staging and production environments.

Possible Solution

I've tried a solution where i've added the following lines to my php scripts

if (extension_loaded('newrelic')) {
    newrelic_set_appname('Dashboard PHP '.getenv('APP_ENV_NAME'));
}

But for some reason this does not seem to work with our laravel artisan queue worker (maybe because the queue runner forks a new worker process)

A better solution would be the possibility to use environment variables, either through the .ini file, or let the agent read the environment directly.

Additional context

Some people think the best way for configuration is via environment variables (https://12factor.net/config)
But maybe i missed something or there is a better solutions to this problem 😄

@Jimbolino Jimbolino added the enhancement New feature or request label Oct 4, 2024
@workato-integration
Copy link

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

1 participant