A repo for learning how to use Jaeger with a simple Django polling app.
- Start the Django stack:
docker-compose up -d website
- View the Jaeger console:
http://localhost:8080
- View the app:
http://localhost
- Start the slides:
docker-compose up -d slides
- View the slides:
http://localhost:8000
. (NOTE:$PWD/slides.md
must be present.)
To impart some load on your simple webapp, run scripts/load_runner.sh
. By default,
this will try to access questions in the poll (many won't exist, so you can see
what happens under failure) and cast some random votes.
This will run 100 times by default. To change this, simply run:
ITERATIONS=$NUMBER_OF_ITERATIONS scripts/load_runner.sh
While you're doing this, take a look at the Jaeger console at http://localhost:8080
. You should
see latency data points and traces for each span (visit) recorded.
-
Instead of configuring
app/website/settings.py
directly, this installation of Django uses an environment file for controlling its settings. The templatized version of it is located atconf/website.yaml.tmpl
; thegenerate-website-configs
Docker Compose service renders it.To recreate this file and reload Django, run
docker-compose restart generate-website-configs website
. -
In conjunction with the above, this implementation uses environment dotfiles to store sensitive information, such as the server
SECRET_KEY
. This makes this installation slightly more production-ready. -
To maintain a UNIX-like philosophy (do one thing; do it well), code for initializing tracing and databases lives in
app/website/{tracing, databases}.py
, respectively.
- The Python
jaeger-client
is not compatible with OpenTracing v2 (despite its maintainer working on OpenTracing at Uber 🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔). There is a fork and pull request that fixes this, despite it failing PR tests. When this PR gets merged, therequirements.txt
file will look slightly cleaner.