Newrelic-lambda-cli

Latest version: v0.9.5

Safety actively analyzes 688758 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 13 of 13

0.1.4

* Removes default value for `--aws-profile` to allow boto3 to find credentials elsewhere 42

0.1.3

* Fixes import error in `newrelic_lambda_cli.functions` 38

0.1.2

* Adds warning for functions with pre-existing log subscription filters 33
* Adds `python3.8` runtime support 32
* Adds `subscriptions` command group to manage log subscription filters 27
* Fixes import bug with `graphql-core` 29

0.1.1

* Fixes typos related to the AWS Lambda integration role 26 (thanks igoratron)

0.1.0

Initial Release

nr-onboarding-script
This is for the old version of this tool. See github.com/newrelic/newrelic-lambda-cli for the latest version and documentation.

Enable New Relic monitoring of AWS Lambda Cloudwatch Logs

New Relic monitoring for AWS Lambda offers in-depth performance monitoring for your Lambda functions. This document explains how to enable this feature and get started using it.

This requires you to have the AWS CLI setup and at least Python 2.6.6 installed.


Configure AWS to communicate with New Relic
In this section, you'll run a set-up script that does the following:

- Configures your AWS account and Lambda function to communicate with New Relic.
- Configures a New Relic log-ingestion Lambda that will send your Lambda log data to New Relic.

To use the script:
1. Ensure you've downloaded [the script](https://github.com/newrelic/newrelic-lambda-cli/archive/nr-onboarding-script.zip) and meet its requirements.
a) Go to the newrelic-lambda-cli-master directory:
`cd newrelic-lambda-cli-master`
b) Add execution permissions to the newrelic-cloud script:
`chmod +x newrelic-cloud`
2. Optional: If you have multiple AWS profiles and don't want to use the default, use `AWS_DEFAULT_PROFILE`[environment variable](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) to set another profile name. Ensure the profile is properly configured (including the default region). Example:


export AWS_DEFAULT_PROFILE=MY_OTHER_PROFILE

3. Run the following command in the same directory where the script is located:

./newrelic-cloud set-up-lambda-integration --nr-account-id YOUR_ACCOUNT_ID \
--linked-account-name YOUR_LINKED_ACCOUNT_NAME \
--nr-api-key YOUR_NR_API_KEY


Notes:

- This defaults to US. If you are integrating with the New Relic EU region, add the following argument:


--nr-region "eu"

- The value of `YOUR_ACCOUNT_ID` can be seen in the address bar when on the New Relic site `https://rpm.newrelic.com/accounts/<YOUR_ACCOUNT_ID>`
- `YOUR_LINKED_ACCOUNT_NAME` is the name of your AWS account that will appear in NR Cloud integrations. It is used to easily identify your account in NR. The cloud account will be created if it does not exist yet.
- The value of your `YOUR_NR_API_KEY` is your Personal API Key. This is not the same as your New Relic REST API key. To generate an API key for an existing user:
- Ensure you are the account Owner or Admin on the account.
- Go to [rpm.newrelic.com](https://rpm.newrelic.com) > (account dropdown) > Account settings > Account > Users and roles.
- Select the user.
- Select + New API key.
- When prompted, confirm key creation.
- For more information about other arguments, see [New Relic's Lambda documentation on GitHub](https://github.com/newrelic/nr-lambda-onboarding#arguments) .

4. Optional: If you want to stream all logs to New Relic Logs:
1. Go to the New Relic `newrelic-log-ingestion` Lambda and set the `LOGGING_ENABLED` environment variable to `true`
2. Remove the `NR_LAMBDA_MONITORING` Subscription filter pattern. Go to the Log Group for each monitored Lambda, remove the `newrelic-log-ingestion` subscription and re-add it back. (There is no way to edit existing filter patterns).

For more manual alternatives to using the script, or to learn what actions it performs, see the [manual instructions](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/enable-new-relic-monitoring-aws-lambda#manual-setup).

Page 13 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.