Lab
This procedure is a part of lab that teaches you how to build a quickstart. If you haven't already, check out the lab introduction.
Before you build a quickstart, you need to spin up a docker container. The container consists of two important services:
- A python program that mimics the database and also provides functions for create, read, update, and delete (CRUD) operations. It also makes use of newrelic_telemetry_sdk to send telemetry data to New Relic.
- A simulator service that generates dummy database traffic so you don't have to manually perform CRUD operations
To spin up these services, you first need to set NEW_RELIC_INSERT_KEY
environment variable.
Prepare your environment
On your local machine, set your license key in an environment variable:
$export NEW_RELIC_INSERT_KEY=<YOUR_LICENSE_KEY>
Your mock database uses this key to write telemetry data to New Relic. You can find your New Relic license key in your account settings.
Spin up demo services
Clone the lab repository from GitHub:
$git clone https://github.com/newrelic-experimental/build-a-quickstart-lab.git
This repository contains the code for Flashdb as well as the simulator for dummy database traffic. Navigate to the demo directory and execute the following commands to build and run docker image:
$docker build -t flashdb . $docker run -e NEW_RELIC_INSERT_KEY=$NEW_RELIC_INSERT_KEY flashdb
Here, you build and run docker image that generates mock database traffic. You will observe this data in New Relic. Once the docker image is up and running, you see the following output in your terminal:
$docker build -t flashdb .$docker run -e NEW_RELIC_INSERT_KEY=$NEW_RELIC_INSERT_KEY flashdbWriting...try_sendWriting...try_sendReading...try_sendReading...try_sendSent metrics successfully!sending event...Event sent successfully!Writing...try_sendWriting...try_sendReading...
Next, you observe this data in New Relic using dashboard.
Lab
This procedure is a part of lab that teaches you how to build a quickstart. Continue on to next lesson: Create a dashboard.