diff --git a/tasks.py b/tasks.py index 64eb82a..56b42a8 100644 --- a/tasks.py +++ b/tasks.py @@ -53,5 +53,12 @@ def build_image(c, dev=True, registry_user=None, registry_token=None, push=False @task -def serve_dev(c): - c.run("FLASK_APP=./learn_otel/app.py flask run -p 8888") +def serve_dev(c, otel=False): + if otel: + c.run( + "FLASK_APP=./learn_otel/app.py OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true " + "opentelemetry-instrument --traces_exporter console --metrics_exporter console --logs_exporter console " + "--service_name dice-server flask run -p 8888" + ) + else: + c.run("FLASK_APP=./learn_otel/app.py flask run -p 8888")