You're attempting to enable serverless monitoring for AWS Lambda and are having an issue or error.
There are two common problems related to not completing all of the enablement procedures:
- Not seeing data on CloudWatch metrics UI page. This means the AWS integration step wasn't completed.
- Not seeing data on Troubleshooting category UI pages. If you aren't seeing data on the Distributed tracing, Errors, and Invocations UI tabs, this means the APM agent instrumentation step wasn't completed.
Besides these basic enablement problems, there are some additional problems that may cause an issue:
CloudWatch error "HTTP error 401: unauthorized." This is due to an incorrect API Key. The
--nr-api-keyargument in the Configure AWS enable step takes your , which is different from the REST API key.
Invocations missing. To see invocation breakdown details, distributed tracing must be enabled as part of the Lambda instrumentation step. Distributed tracing is required so that span details can be displayed in the invocation details pane.
You've completed the installation, integration, and instrumentation steps correctly, and your function is sending logs to CloudWatch but you're not seeing traces for specific dependencies (or any traces) in the UI. This may result from the order of layer merging (if you're using our Lambda layers) or from the order of import (if you're instrumenting manually):
- If you're instrumenting with layers: make sure in your function configuration that the New Relic layer is merged before other layers (though if your function uses webpack, the New Relic layer should be merged after the webpack layer).
- If you're instrumenting a Node.js function manually, make sure that logging is enabled, and that your function imports newrelic before it imports any dependencies you expect to monitor.
- If you're using ES Modules with a Node.js function, make sure that the environment variable
NEW_RELIC_USE_ESMis set to
true. Additionally, make sure you're using async/await or promises for handling asynchronous behavior in your function, as callback-based functions are not supported when using ES Modules.
If none of these solutions help you, contact our support team. The following information will help you when you talk to support technicians:
- Has the Lambda function appeared in the UI before? If so, what is the name of the function?
- If some data for the Lambda function is appearing in the UI, what specific data is appearing?
- What APM language agent are you using to instrument the function?