Problem
You have config parameters defined in the infrastructure agent and you want to pass the parameters to an on-host integration.
Solution
You can pass config parameters set in the agent to on-host integrations by adding the variable passthrough_environment
to the infrastructure agent's configuration file.
Starting with infrastructure agent 1.24.1 passthrough_environment
supports regex for variable names.
For example, if you want to pass the proxy options configured in the infrastructure agent to an integration, add the following configuration to the infrastructure config file:
passthrough_environment: - HTTPS_PROXY - HTTP_PROXY - MY_REDIS_PASSWORD - NRIA_.*
Starting with infrastructure agent 1.14.0, you can also define environment variables as part of the integration configuration file as shown below (passthrough_environment
config is also required):
integration_name: com.newrelic.redisinstances: - name: redis-metrics command: metrics arguments: hostname: localhost port: 6379 password: {{MY_REDIS_PASSWORD}}