#!/bin/bash12set -euo pipefail34export OTEL_METRIC_EXPORT_INTERVAL="5000" # so we don't have to wait 60s for metrics5export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=localhost:8082"67python3 -m venv venv8source ./venv/bin/activate910# How to get the requirements.txt file?11# 1. Follow https://opentelemetry.io/docs/languages/python/getting-started/12# 2. Run `pip freeze > requirements.txt` in the same directory as your app.py file13pip install -r requirements.txt1415# Step 1: Install the OpenTelemetry SDK16pip install 'opentelemetry-distro[otlp]==0.46b0'17opentelemetry-bootstrap -a install1819# Step 2: Run the application20export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true21export OTEL_LOGS_EXPORTER=otlp22opentelemetry-instrument flask run -p 8082232425