WayScript's NewRelic integration allows you to connect to your NewRelic account and set up default monitoring across your workspace's Lairs. You’ll get automatic visibility into the health of all pre-production, staging, and production environments via New Relic.
Adding the integration with enable two monitoring capabilities in your workspace Lairs:
- Auto-initialized infrastructure monitoring (only available in self-hosted deployments)
- Ability to configure APM agents and log forwarding
There are four main steps for connecting WayScript and New Relic:
- Open a workspace for your team
- Create your first Lair
- Enable the New Relic integration in WayScript
- Set up a New Relic APM agent in your Lair
- 1.Sign up for a free WayScript account or sign in to an existing account.
2. Create a workspace. Your WayScript workspace is where you and your team will collaborate on managing and shipping software. Note that you can invite others on your team to the workspace by selecting + Invite Team Member at the bottom left of the screen.
To create a Lair in your workspace:
- 1.Select the Lair tab in the left panel to navigate back to the Lair view.
- 2.In the Lair view, select + New Lair in the top right of the screen.
- 3.To get started coding from scratch, select a pre-built template to customize or create a blank Lair. Follow this WayScript guide for some inspiration for tools to build. For now, you can select the Flask template under Frameworks.
- 2.Create a New Relic integration in WayScript. In WayScript, go to integrations by selecting the Workspace dropdown menu in the top left corner. Select Settings, and then Integrations. On the integrations page, select +New Integration, and then New Relic.
- 4.In WayScript, complete the integration by selecting Create integration.
1. Configure the APM agent in the WayScript terminal. Select the Lair you want to monitor and select the Develop tab in the left panel. In the terminal that opens in the right panel, run these commands to generate the
newrelic.iniconfig file for the Lair: pip install newrelic
pip install newrelic
newrelic-admin generate-config YOUR_LICENSE_KEY newrelic.ini
2. Add New Relic to your
requirements.txtfile. Open the code editor by clicking on the Show Code icon in the bottom left pane. Select the
requirements.txtfile and add the following at the bottom of the file. If your Lair does not have a
requirements.txtfile, you can create one directly in the code editor:
3. Add a deploy trigger. Open the Triggers panel by clicking the last icon, Show Triggers, in the bottom left pane. Click the + icon at the top of the Triggers panel and select deploy. Paste the following command in Command to Run:
NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program $YOUR_COMMAND_OPTIONS
Be sure to replace
$YOUR_COMMAND_OPTIONSwith your app’s command line, for example,
- 1.Test the connection. Invoke a process in your Lair. (Select the play icon under Run on the deploy trigger or navigate to the Lair endpoint.)
- 2.Deploy your Lair to prod. Select Deploy from the left panel to open the deploy view and click Deploy. This promotes your changes from your development environment to an identical production environment with unique endpoints and will automatically run your deploy trigger.
- 3.Wait a few minutes for New Relic to start receiving your data. It should only take 5-10 minutes.