Demo OTEL App is a small Flask service used to learn observability with OpenTelemetry. It includes traces, logs, and custom metrics for two simple operations:
- Dice rolling
- Random ID generation
The project is intentionally compact so you can read the full code path and safely experiment.
This repository is designed for developers who are new to observability but already comfortable reading and running code. You can use it to:
- understand baseline OTEL wiring in a web app
- generate realistic traffic and errors
- inspect metrics, traces, and logs in one place
- extend instrumentation with your own telemetry
- Flask API + minimal UI
- Feature flags for app capabilities
- Environment-driven config with runtime config view (
/app-config) - OTEL tracing, log export, and custom metrics
- Optional OTLP export endpoint
- Local scripts for load generation and container builds
simple-container-app/
├─ docs/
│ ├─ quickstart.ipynb
│ └─ observability.md
├─ src/
│ ├─ app.py
│ ├─ config.py
│ ├─ instrumentation.py
│ ├─ models.py
│ ├─ templates/
│ └─ static/
├─ Containerfile
├─ .containerignore
├─ build.sh
├─ test.sh
├─ requirements.txt
├─ example.env
└─ README.md
Use the quickstart notebook:
It includes:
- prerequisites
- local app startup
- local container build/run
- traffic generation tests
For Linux and Windows workflows.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp example.env .env
python src/app.pyOpen:
http://127.0.0.1:8080
chmod +x build.sh
./build.sh --image-name demo-otel-app --tag localRun:
docker run --rm -p 8080:8080 --env-file .env demo-otel-app:localThis repository contains a minimal Helm chart in helm/ for demo deployments.
Resources created by the chart:
Deployment(app pods + health probes)ConfigMap(application environment configuration)Service(ClusterIP by default)Ingress(optional, with optional TLS + custom annotations)
The chart also supports:
common_labelsandcommon_annotationsapplied to all resources- ingress-specific annotations (for example cert-manager cluster issuer)
- post-install guidance via
helm/templates/NOTES.txt
Example install:
helm upgrade --install demo-otel-app ./helm \
--namespace demo-otel --create-namespaceEnable ingress + TLS (example):
helm upgrade --install demo-otel-app ./helm \
--set ingress.enabled=true \
--set ingress.host=demo-otel.local \
--set ingress.tls.enabled=true \
--set ingress.tls.secretName=demo-otel-app-tls \
--set ingress.annotations.cert-manager\\.io/cluster-issuer=letsencrypt-prodchmod +x test.sh
./test.sh --host 127.0.0.1 --port 8080 --operation all --iterations 20- Quickstart (Linux + Windows): docs/quickstart.ipynb
- Observability extension guide: docs/observability.md
Primary app config is loaded from environment variables in src/config.py.
Important keys:
APP_NAMEAPP_VERSIONAPP_OWNERAPP_PORTAPP_DEBUGAPP_LOG_LEVELENABLE_OTELENABLE_DICE_ROLLERENABLE_RANDOM_ID_GENERATOROTEL_SERVICE_NAMEOTEL_SERVICE_VERSIONOTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_HEADERS
Use example.env as the baseline.
GET /api/healthGET /api/endpointsGET /api/statsGET /api/rolldice?player=<name>&sides=<2-100>(if enabled)GET /api/generate-id?prefix=<text>&size=<4-64>(if enabled)
This project is currently not seeking external collaborators.
No license file is currently included in this repository.
Add a LICENSE file before using this project in open distribution.