diff --git a/Justfile b/Justfile index 2a66046c80..2e32cbe796 100644 --- a/Justfile +++ b/Justfile @@ -176,19 +176,25 @@ debug *args: wait "$dlv_pid" # Run otel collector in a docker container to stream local (i.e. from ftl dev) signals to -# the terminal tab where this is running. To stop the stream, run `just otel-stop` in a -# second terminal window. +# the terminal tab where this is running. To start FTL, opepn another terminal tab and run +# `just otel-dev` with any args you would pass to `ftl dev`. To stop the otel stream, run +# `just otel-stop` in a third terminal tab. +grpcPort := `cat docker-compose.yml | grep "OTLP gRPC" | sed 's/:.*//' | sed -r 's/ +- //'` otel-stream: docker run \ - -p 4317:4317 \ + -p {{grpcPort}}:{{grpcPort}} \ -p 55679:55679 \ otel/opentelemetry-collector:0.104.0 +# Stop the docker container running otel. otelContainerID := `docker ps -f ancestor=otel/opentelemetry-collector:0.104.0 | tail -1 | cut -d " " -f1` otel-stop: docker stop "{{otelContainerID}}" -# Run `ftl dev` with the given args after setting the necessary envar +# Run `ftl dev` with the given args after setting the necessary envar. otel-dev *args: - export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 + #!/bin/bash + + gprcPort=$(cat docker-compose.yml | grep "OTLP gRPC" | sed 's/:.*//' | sed -r 's/ +- //') + export OTEL_EXPORTER_OTLP_ENDPOINT="localhost:${gprcPort}" ftl dev {{args}}