Run the following commands to install the appropriate packages.
pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
Run the application with following commands.
export DJANGO_SETTINGS_MODULE=helloworld_project.settings
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.kloudmate.com:4318
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=<private key>"
export OTEL_SERVICE_NAME=<service_name>
opentelemetry-instrument --traces_exporter otlp --metrics_exporter otlp --exporter_otlp_protocol http/protobuf python manage.py runserver --noreload
- Your must define
DJANGO_SETTINGS_MODULEappropriately. In this example my project ishelloworld_project - Replace
<service_name>with your application name - Replace
<private key>with your private workspace API key
More Details RTFM