Add otel to local dev

main
Drew Bednar 11 months ago
parent 1749077e5f
commit b3560c34b4

@ -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")

Loading…
Cancel
Save