• Log inStart now

Set up your lab environment

5 min

lab

This procedure is part of a lab that teaches you how to get started with New Relic to monitor your application. If you haven't already, check out the lab introduction.

Before you can walk through the lab, you need to spin up your React application.

Step 1 of 8

Clone the lab repository.

bash
$
git clone https://github.com/newrelic-experimental/relicstaurants.git
Step 2 of 8

Navigate to the root directory of your application and switch to the lab directory.

bash
$
cd relicstaurants
$
git switch nr-basics-lab-material
Step 3 of 8

Next, install dependencies, and run the application.

bash
$
npm install
$
npm run build
$
npm run newstart

This opens your Relicstaurants application in your browser.

relicstaurants homepage

Enter your delivery address and search to get started.

nearby restaurant list

Here, you see a list of restaurants where you can order food.

Step 4 of 8

Choose a restaurant.

choose a restaurant

Step 5 of 8

Select an item or two, and click on the cart in the upper right corner.

select food

Step 6 of 8

Click PAY.

checkout

Step 7 of 8

Enter a fake card information and click Finish payment to place the order.

purchase

Next, you use a simulator to generate more traffic to your application.

Step 8 of 8

In another terminal window, navigate to the root directory of your application, and run the load generator.

bash
$
# Navigate to the root directiory of your application
$
cd relicstaurants/simulator
$
# Switch to lab branch
$
git switch nr-basics-lab-material
$
# Create a virtual environment
$
python3 -m venv venv
$
# Activate the virtual environment
$
source venv/bin/activate
$
# Install the simulator's dependencies
$
pip install -r requirements.txt
$
# Run the simulator
$
python simulator.py
====== WebDriver manager ======
Current google-chrome version is 99.0.4844
Get LATEST chromedriver version for 99.0.4844 google-chrome

Important

This load generator assumes you have Google Chrome installed on your computer. If you're using a different browser, either skip this step and generate traffic manually, or install Google Chrome.

Now, that you know how to run your application, it's time to instrument it. In the terminal windows that are running your application and simulator, press <CTRL-C> to shut them down. With your app shut down, you'll be able to update your code to introduce monitoring tools.

lab

This procedure is part of a lab that teaches you how to get started with New Relic to monitor your application. Now that you've set up your environment, instrument your application with APM agent.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.