Project – Datadog Starter Observability Lab for Ubuntu

Uncategorized

Project name

Datadog Starter Observability Lab for Ubuntu

Project idea

Students deploy a very small web app on Ubuntu Linux and then connect it to Datadog step by step:

  • Datadog Agent for host and infra metrics
  • APM for request tracing
  • Logs for application logs
  • Synthetic Monitoring for uptime/API checks
  • RUM for browser/user monitoring
  • Alerts/Monitors
  • Dashboard
  • API call to read or create Datadog objects

This matches Datadog’s model well: the Agent runs on hosts and sends host telemetry, APM adds traces from the app, log collection can be enabled in the Agent config, Synthetic API tests monitor endpoints, Browser RUM captures page loads/actions/errors, monitors alert on thresholds, dashboards visualize the data, and the Datadog API uses API/Application keys. (Datadog)

Why this is good for basic students

It is small enough for 1–2 hours, but still gives them an end-to-end observability experience:

  1. run an app
  2. generate traffic
  3. see metrics
  4. see traces
  5. see logs
  6. test availability
  7. create alerts
  8. build one dashboard
  9. make one API call

Recommended app

Use a very small Python Flask app on Ubuntu with these endpoints:

  • / → normal page
  • /health → returns 200 OK
  • /slow → sleeps 2–5 seconds
  • /error → returns HTTP 500
  • /api/items → simple JSON response

Also write logs to a file like /var/log/studentapp/app.log, because Datadog’s Python log collection guidance is straightforward with file logging plus Agent tailing. (Datadog)

What students must do

1. About Datadog

Ask them to explain in 2–3 lines:

  • What Datadog is
  • Difference between metrics, logs, traces, synthetics, and RUM

2. Datadog Agent + Infra Monitoring

Install the Agent on Ubuntu and confirm the host appears in Datadog. The Agent is Datadog’s host-side collector, and Datadog’s Linux docs note the main config file is /etc/datadog-agent/datadog.yaml. (Datadog)

Student task:
Show these host metrics on screen:

  • CPU
  • Memory
  • Disk
  • Network

3. APM Monitoring

Instrument the Flask app with Datadog tracing so requests to /, /slow, and /error show up as traces. Datadog’s APM docs describe instrumentation as adding code/SDK support so the app sends traces, metrics, and related telemetry. (Datadog)

Student task:
Generate traffic and identify:

  • which endpoint is slowest
  • which endpoint throws errors

4. Log Monitoring

Enable log collection in the Agent by turning on logs_enabled in datadog.yaml, then configure the Agent to tail the application log file. Datadog’s log collection docs describe exactly this flow. (Datadog)

Student task:
Search logs and find:

  • all error logs
  • logs from /slow
  • one specific user request

5. Synthetic Monitoring

Create one API Synthetic test for /health. Datadog’s Synthetic docs say API tests proactively monitor important services and can check things like expected status code and latency. (Datadog)

Student task:
Create a test that fails when:

  • status code is not 200
  • response time is too high

6. RUM Monitoring

Add Datadog Browser RUM to the home page. Datadog’s Browser SDK docs say RUM can capture page loads, user actions, resource loading, and application errors in real time. (Datadog)

Student task:
Open the page in a browser a few times and confirm they can see:

  • page views
  • page load performance
  • a frontend click or user action

7. Alerts / Monitors

Create two simple monitors:

  • CPU high on the Ubuntu host
  • error count or failed Synthetic test

Datadog’s monitor docs say metric monitors alert when a metric crosses a threshold over a period of time. (Datadog)

8. Dashboard

Create one dashboard called Student App Observability with:

  • CPU timeseries
  • Memory timeseries
  • request count
  • latency
  • error count
  • log stream/list widget
  • Synthetic status

Datadog’s dashboard docs recommend organizing larger dashboards with tabs, but for this lab one simple dashboard is enough. (Datadog)

9. API

Use one simple Datadog API call:

  • list dashboards, or
  • create a dashboard/monitor

Datadog’s API docs say the API is REST/JSON and uses DD-API-KEY; some endpoints also require DD-APPLICATION-KEY. Datadog also notes API keys are required for the Agent to submit data. (Datadog)

Best 1–2 hour execution plan

First 20 minutes

  • run Flask app
  • install Datadog Agent
  • verify host metrics

Next 20 minutes

  • enable APM
  • hit /, /slow, /error
  • inspect traces

Next 15 minutes

  • enable log collection
  • view logs in Datadog

Next 15 minutes

  • create one Synthetic API test

Next 15 minutes

  • add Browser RUM to homepage

Last 15 minutes

  • create 2 monitors
  • build 1 dashboard
  • run 1 Datadog API call

Expected deliverables from students

Each team should submit:

  • screenshot of Infrastructure host page
  • screenshot of APM traces
  • screenshot of Logs search
  • screenshot of Synthetic test result
  • screenshot of RUM view
  • screenshot of 2 monitors
  • screenshot of 1 dashboard
  • one curl command for Datadog API
  • short note: “What issue did we detect fastest with Datadog?”

Very simple scoring rubric

  • Agent + host metrics working
  • APM visible
  • logs searchable
  • Synthetic test working
  • RUM visible
  • 2 monitors created
  • 1 dashboard created
  • 1 API call successful

Final project statement you can give students

Deploy a small Flask web app on Ubuntu and make it fully observable in Datadog using Agent, Infrastructure Monitoring, APM, Logs, Synthetics, RUM, Monitors, Dashboard, and one Datadog API call. Then generate normal, slow, and failing traffic and show how Datadog helps detect each condition.

My recommendation

Keep the project to one host + one app + one browser page + one synthetic test.


How to download code?

sudo wget -O datadog-starter-lab-python-app.zip \
https://projectxxxxxxxx.s3.ap-south-1.amazonaws.com/datadog-starter-lab-python-app-main.zip

sudo apt install zip

sudo unzip datadog-starter-lab-python-app-main.zip

Datadog Starter Observability Lab

This project is a tiny Flask app for beginner Datadog training on Ubuntu.

Files

  • app.py – main web app
  • templates/index.html – homepage with optional Datadog Browser RUM snippet
  • requirements.txt – Python dependencies

Quick start

sudo apt update
sudo apt install -y python3 python3-venv python3-pip curl
mkdir -p ~/datadog-lab
cd ~/datadog-lab

Copy these project files into the folder, then run:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
sudo mkdir -p /var/log/studentapp
sudo chown -R $USER:$USER /var/log/studentapp
python3 app.py

Open:

  • http://SERVER_IP:5000/
  • http://SERVER_IP:5000/health
  • http://SERVER_IP:5000/slow
  • http://SERVER_IP:5000/error
  • http://SERVER_IP:5000/api/items

Run with Datadog tracing

After the Datadog Agent is installed:

export DD_SERVICE=studentapp
export DD_ENV=lab
export DD_VERSION=1.0.0
export DD_LOGS_INJECTION=true
export DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED=true
export DD_AGENT_HOST=127.0.0.1

ddtrace-run python3 app.py

Enable Browser RUM

Set these before starting the app:

export DD_RUM_ENABLED=true
export DD_CLIENT_TOKEN=YOUR_CLIENT_TOKEN
export DD_APPLICATION_ID=YOUR_RUM_APPLICATION_ID
export DD_SITE=datadoghq.com

Then restart the app.

Sample traffic generator

In another terminal:

for i in {1..10}; do curl -s http://127.0.0.1:5000/ > /dev/null; done
for i in {1..5}; do curl -s http://127.0.0.1:5000/api/items > /dev/null; done
for i in {1..3}; do curl -s http://127.0.0.1:5000/slow > /dev/null; done
for i in {1..2}; do curl -s http://127.0.0.1:5000/error > /dev/null; done

Note – You need to do the project without much trainer help.

I’ve packaged a ready-to-use beginner lab with working code and a simple README:
[Download the starter project ZIP] – https://github.com/devopsschool-assignment-projects/datadog-starter-lab-python-app
[View the README] – https://github.com/devopsschool-assignment-projects/datadog-starter-lab-python-app
[View the Flask app]- https://github.com/devopsschool-assignment-projects/datadog-starter-lab-python-app

What students will build

A tiny Ubuntu-hosted web app with:

  • /health
  • /api/items
  • /slow
  • /error
  • one simple HTML page for RUM

Then they will connect it to:

  • Datadog Agent
  • Infra Monitoring
  • APM
  • Logs
  • Synthetic Monitoring
  • RUM
  • Alerts
  • Dashboard
  • API

Datadog’s docs support this exact flow: install the Agent on Linux, enable traces, turn on log collection in datadog.yaml, add a custom log file config under conf.d, create Browser RUM with a clientToken and applicationId, add Synthetic API assertions like status code and response time, and use API/Application keys for API access. ([Datadog][1])

Exact student steps

1) Prepare Ubuntu

Run this:

sudo apt update
sudo apt install -y python3 python3-venv python3-pip curl unzip

Flask’s official docs support installing Flask with pip inside a virtual environment. ([Flask Documentation][2])

2) Unzip the project

Copy datadog-starter-lab.zip to the Ubuntu machine, then run:

mkdir -p ~/datadog-lab
cd ~/datadog-lab
unzip datadog-starter-lab.zip
cd datadog-starter-lab

3) Create Python environment and install packages

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

4) Prepare app log folder

sudo mkdir -p /var/log/studentapp
sudo chown -R $USER:$USER /var/log/studentapp

5) Install Datadog Agent on Ubuntu

For a Linux host, Datadog’s tutorial shows this install pattern; replace the API key and adjust DD_SITE if your org is not on datadoghq.com. ([Datadog][3])

DD_AGENT_MAJOR_VERSION=7 DD_API_KEY=YOUR_DATADOG_API_KEY DD_SITE="datadoghq.com" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"

Start it:

sudo service datadog-agent start
sudo datadog-agent status

Datadog’s docs say Linux Agent install is done with the generated Linux script, and their tracing tutorial shows sudo service datadog-agent start on Linux. ([Datadog][1])

6) Enable log collection in the Agent

Datadog says log collection is not enabled by default and you must set logs_enabled: true in datadog.yaml. ([Datadog][4])

Edit:

sudo nano /etc/datadog-agent/datadog.yaml

Find this line and change it to:

logs_enabled: true

7) Tell Datadog Agent to read the app log file

Datadog’s host log docs say to create a new folder under conf.d/, place a conf.yaml there, then restart the Agent. ([Datadog][5])

Run:

sudo mkdir -p /etc/datadog-agent/conf.d/studentapp.d
sudo nano /etc/datadog-agent/conf.d/studentapp.d/conf.yaml

Paste this:

logs:
  - type: file
    path: /var/log/studentapp/app.log
    service: studentapp
    source: python

Restart the Agent:

sudo systemctl restart datadog-agent
sudo datadog-agent status

Datadog also notes that on Linux the Agent runs as the datadog-agent user, so log file permissions matter. ([Datadog][6])

8) Run the app with APM enabled

Datadog’s Python tracing docs support starting a Python app with ddtrace-run, and DD_SERVICE / DD_VERSION are valid config env vars for framework integrations like Flask. ([Datadog][7])

Run:

source venv/bin/activate

export DD_SERVICE=studentapp
export DD_ENV=lab
export DD_VERSION=1.0.0
export DD_LOGS_INJECTION=true
export DD_AGENT_HOST=127.0.0.1

ddtrace-run python3 app.py

9) Open the app

On the Ubuntu machine:

curl http://127.0.0.1:5000/health

In a browser:

http://YOUR_UBUNTU_IP:5000/

10) Generate traffic for APM and Logs

Open another terminal and run:

for i in {1..10}; do curl -s http://127.0.0.1:5000/ > /dev/null; done
for i in {1..5}; do curl -s http://127.0.0.1:5000/api/items > /dev/null; done
for i in {1..3}; do curl -s http://127.0.0.1:5000/slow > /dev/null; done
for i in {1..2}; do curl -s http://127.0.0.1:5000/error > /dev/null; done

Now students should see:

  • host metrics from the Agent
  • traces for the Flask app
  • logs from /var/log/studentapp/app.log

Datadog’s APM getting-started flow is: set up tracing, run the app, generate traffic, then explore collected traces. ([Datadog][8])

Exact RUM setup

Datadog’s Browser RUM docs say you first create a JS application in Datadog, which generates a clientToken and an applicationId, then add the SDK snippet to the page. ([Datadog][9])

11) Create the RUM app in Datadog

In Datadog UI:

  • Go to Digital Experience
  • Click Add an Application
  • Choose JavaScript (JS)
  • Create the app
  • Copy:
  • clientToken
  • applicationId

12) Restart the app with RUM enabled

source venv/bin/activate

export DD_SERVICE=studentapp
export DD_ENV=lab
export DD_VERSION=1.0.0
export DD_LOGS_INJECTION=true
export DD_AGENT_HOST=127.0.0.1

export DD_RUM_ENABLED=true
export DD_CLIENT_TOKEN=YOUR_CLIENT_TOKEN
export DD_APPLICATION_ID=YOUR_APPLICATION_ID
export DD_SITE=datadoghq.com

ddtrace-run python3 app.py

The supplied index.html already contains the Datadog Browser RUM snippet. After that, page loads, user interactions, and frontend performance data can appear in RUM. ([Datadog][9])

Exact Synthetic Monitoring step

Datadog’s HTTP API test docs say API tests can assert things like status code and response time. ([Datadog][10])

Create one Synthetic API test:

  • Type: HTTP
  • URL: http://YOUR_UBUNTU_IP:5000/health
  • Assertions:
  • status code = 200
  • response time < 2000 ms

Exact Monitor tasks

Ask students to create these 2 monitors:

  1. CPU monitor on the Ubuntu host
  2. Synthetic failure monitor for /health

Datadog’s monitor docs cover metric threshold monitors, and Synthetics results can also be used operationally for alerting. ([Datadog][11])

Exact Dashboard tasks

Ask students to create one dashboard called:

Student App Observability

Add widgets for:

  • CPU
  • Memory
  • request count
  • latency
  • error count
  • log stream
  • Synthetic result

Datadog dashboards are intended for combining these telemetry views in one place. ([Datadog][12])

Exact API task

Datadog’s API docs say:

  • write requests need an API key
  • read requests also need an Application key
  • headers are DD-API-KEY and DD-APPLICATION-KEY ([Datadog][13])

Give students this exact example:

export DD_API_KEY=YOUR_API_KEY
export DD_APP_KEY=YOUR_APPLICATION_KEY

curl -X GET "https://api.datadoghq.com/api/v1/dashboard/lists/manual" \
  -H "Accept: application/json" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

If they use EU instead of US1, use the Datadog EU API host instead. Datadog’s auth docs note that API hosts vary by site. ([Datadog][13])

What students should submit

Have each team submit:

  • screenshot of Infrastructure host
  • screenshot of APM traces
  • screenshot of Logs Explorer
  • screenshot of RUM
  • screenshot of Synthetic test
  • screenshot of 2 monitors
  • screenshot of dashboard
  • output of the curl API command

Teacher note

Send to an email to DevOps@rajeshkumar.xyz

0 0 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ava Lewis
Ava Lewis
12 days ago

I really love how this lab simplifies Datadog setup on Ubuntu, making observability feel much more approachable for everyone.

1
0
Would love your thoughts, please comment.x
()
x