Skip to content

Commit

Permalink
complete Justfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deniseli committed Jul 10, 2024
1 parent 876340b commit 9ba83e2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 9ba83e2

Please sign in to comment.