Basic demo application showcasing Django + Prometheus + Kubernetes. For more reading about the why and how of custom metrics with Django, you can check out the post custom application metrics with Django, Prometheus, and Kubernetes.
You'll need Docker installed and a Kubernetes cluster to deploy Prometheus to (Minikube should work just fine). You'll also need to install the Tiller server into the cluster and have the client available locally.
# in real life, we wouldnt VC the .htpasswd, but this is easy
kc create secret generic prometheus-basic-auth --from-file=.htpasswd=prometheus/.htpasswd
make
helm upgrade --install prometheus stable/prometheus -f helm/prometheus/values.yaml
The primary urls for interacting with the app are:
- /walks/start/
- /walks/<walk_id>/complete/
- /walks/<walk_id>/status/
You can perform some actions at these locations, then verify that metrics are set properly by either:
- Visiting the Prometheus server at http://localhost:9090
- Using the
/metrics
endpoint to manually verify
docker-compose up -d