This directory contains a Django web app and commands to both produce and ingest telemetry. The goals of this functionality are to:
- Demonstrate auto and manual instrumentation
- Provide a way for a user to browse telemetry that thas been ingested
- Test and validate auto-instrumentation end-to-end
The Django web app consists of a page that sends requests to other services, and a page to display metrics that have been ingested locally.
When sending requests from Django to other services, you may select an HTTP client library (one of requests, httplib, or httpx) before sending the request, as these three client libraries are instrumented independently.
Location: ./o11y
The ingest command is a gRPC application that listens for metrics and traces and writes metrics to the local db.
Location: ./o11y/management/commands/ingest.py
The query command accepts a metric name and returns a count of how many metrics in the db match that name.
Location: ./o11y/management/commands/query.py
The print-time command just prints the current time every second.
Location: ./o11y/management/commands/print-time.py
There is no need to start the Django app independently as start.sh in the parent directory starts all services in this repo, but, you may start Django functionality independently:
- Start ingest:
./start.sh [--sdk]
- Start server:
./start_server.sh [--sdk]
- Navigate to http://127.0.0.1:8000/
Add --sdk
to enable instrumentation, otherwise it's not explicitly enabled.