DEV Community

Cover image for Create and monitor WayScript self-service dev environments in minutes
Louis Leung for New Relic

Posted on • Originally published at newrelic.com

Create and monitor WayScript self-service dev environments in minutes

Software development demand—and complexity— is increasing every day, creating a growing challenge for SRE and DevOps teams to keep up and simultaneously support ad hoc internal development needs. Interrupting the SRE workflow to provision and manage environments is costly. Self-service infrastructure for developers can solve this problem, but can be a massive headache to implement and manage.

To tackle this developer self-serve challenge, New Relic and WayScript built an integration that lets you quickly create a developer environment and automatically monitor it with a suite of observability tools. With WayScript and New Relic, you can:

  • Instantly spin up containerized developer environments in a single click.

  • Host full-fledged apps, set up internal microservices, and more, with built-in tools like a terminal and IDE.

  • Monitor and troubleshoot everything you build with an easy connection to the New Relic observability platform.

All developers can get started for free with New Relic and connect with WayScript as part of the more than 480 integrations included with New Relic’s observability platform. Free accounts with New Relic receive 100 GB per month of free data ingest, one full platform user, and unlimited basic users, queries, dashboards, and alerts. With preconfigured cloud-native environments from WayScript and rich observability capabilities from New Relic, you can focus on writing code instead of managing infrastructure.

Automate development environment monitoring with New Relic and WayScript

WayScript is an internal developer platform (IDP) that makes it easy for software developers, SREs, and engineering leaders to take control of their team’s tools and developer environments. You can create self-service, cloud-based developer environments that scale, so SREs don't need to disrupt their workflows to provision one-off environments. WayScript is SOC-2 Type II certified. You can use it on the browser, the desktop app, or self-host WayScript on your own EC2 instance.

Developers can quickly build cron tasks, services, APIs, servers, data pipelines, and any other internal tool, without needing to learn new platforms and technologies. The cloud-based Docker environments come with built-in SSO, Kubernetes, internal data access, and now New Relic monitoring.

Monitor Self-Serve Developer Environments with WayScript | New Relic

With this new integration, you can automatically initialize New Relic to configure application performance monitoring (APM) agents, log forwarding, and more during the initial workspace setup in WayScript. You’ll get automatic visibility into the health of all pre-production, staging, and production environments.

How to create and monitor your environment in minutes

Now let’s try it out. There are just four main steps for connecting WayScript and New Relic:

  1. Open a WayScript workspace for your team.
  2. Create your first Lair for a containerized development environment.
  3. Enable the New Relic integration in WayScript.
  4. Set up a New Relic APM agent in your Lair.

1. Open a WayScript workspace for your team

In WayScript, each team gets access to a WayScript workspace. SRE and DevOps teams preconfigure integrations and set organizational standards for the workspace. Developers in turn rapidly create Lairs in the workspace, the basic building blocks of WayScript.

  1. Sign up for a free WayScript account or sign in to an existing account.

Access WayScript at app.wayscript.com or download the WayScript desktop app available for MacOS and Windows at wayscript.com/downloads.
Create your account by following the sign up instructions.

  1. 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.

2. Create your first Lair in WayScript: a containerized dev environment

A Lair is a preconfigured, containerized, and flexible development environment for your code. They come stocked with handy tools like a cron scheduler, terminal, IDE and endpoint configuration.

Image description

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 inspiration and simple examples. For now, you can select the Flask template under Frameworks.

Image description

3. Enable the New Relic integration in WayScript

Note: To ensure your data moves seamlessly from WayScript to New Relic, make sure to complete the integration by following these steps before you deploy a Lair, which is covered in the next section.

  1. Log in to New Relic or sign up for a free account.

  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.

Monitor Self-Serve Developer Environments with WayScript | New Relic

  1. Enter your New Relic account_id and license_key.

You can find these values on the WayScript data source page in New Relic.
Optionally, you can choose to use a new license key. If so, read the New Relic API key documentation for instructions.

Image description

  1. In WayScript, complete the integration by selecting Create integration.

4. Set up APM for your Lairs (Python example)

Next, install a New Relic APM agent to monitor your Lair and anything you build inside it. WayScript supports development in any language, but this example uses the Python agent. To see all the APM agents available in New Relic, go to Add data, and filter for Application monitoring.

  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.ini config file for the Lair:
pip install newrelic 
newrelic-admin generate-config YOUR_LICENSE_KEY newrelic.ini
Enter fullscreen mode Exit fullscreen mode

Image description

  1. Add New Relic to your requirements.txt file. Open the code editor by selecting the Show Code icon in the bottom left pane. Select the requirements.txt file and add newrelic at the bottom of the file:

Image description

If your Lair does not have a requirements.txt file, you can create one directly in the code editor.

  1. 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
Enter fullscreen mode Exit fullscreen mode

Be sure to replace $YOUR_COMMAND_OPTIONS with your app’s command line, for example, python app.py.

Image description

  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 productions. 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.

Image description

  1. Wait a few minutes for New Relic to start receiving your data. It should take only 5-10 minutes.

Monitor Self-Serve Developer Environments with WayScript | New Relic

That’s it! Now you should be able to see your Lair and applications in New Relic.


To read this full New Relic blog, click here.

Top comments (0)