Open rittneje opened 2 months ago
Hi @rittneje
We haveNEW_RELIC_LAMBDA_EXTENSION_ENABLED
lambda environment variable to enable/disable extension, as defined here
Currently, we see that different language agent is using a different env var to enable instrumentation, as mentioned here. env var for controlling whether the agent is enabled differs across agents: Go: NEW_RELIC_ENABLED Ruby: NEW_RELIC_AGENT_ENABLED Node.js: NEW_RELIC_ENABLED
Since lambda extension supports all language runtimes, it should respect all agent specific env vars. We will look into the issue such that lambda extension should respect the agent enable environment variable. Thank you!
Description
If we set NEW_RELIC_ENABLED=0, the Go agent won't report anything. However, the extension does not respect this env var. Consequently, it waits for telemetry that will never come, and ends up timing out 200 ms before actual timeout. (From AWS's perspective, the function was running the whole time and we get billed for it.)
https://github.com/newrelic/newrelic-lambda-extension/blob/a8461c8ce89bc2411cc5ae5dd7e06e206e3407bd/main.go#L269-L300
Steps to Reproduce
See above.
Expected Behavior
Extension should be a no-op if NEW_RELIC_ENABLED=0.
Relevant Logs / Console output
Your Environment
Additional context