Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.21 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.21 KB

Tutorials

Tracing

Setup

  1. Clone the repository and go to the tracing directory

  2. Create a virtual environment

python3 -m venv . && source ./bin/activate
  1. Install python dependencies
pip install flask
# Installs the API, SDK, and the opentelemetry-bootstrap and opentelemetry-instrument tools
pip install opentelemetry-distro 
# Tool for automatic instrumentation.
opentelemetry-bootstrap -a install
  1. Install Quickwit and start a server
curl -L https://install.quickwit.io | sh
cd quickwit-*
./quickwit run

Auto-instrumentation

Start your app with my_instrumented_app script.

OTEL_METRICS_EXPORTER=none \ # We don't need metrics
OTEL_SERVICE_NAME=my_app \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:7281 \
opentelemetry-instrument python my_instrumented_app.py

Now hit the endpoint http://localhost:5000/process-ip, it will send traces to Quickwit.

Manual instrumentation

Start your app with my_manually_instrumented_app script.

python my_manually_instrumented_app.py

Now hit the endpoint http://localhost:5000/process-ip, it will send traces to Quickwit.