From 876340bc3c9356f9608dcd2f9a4194090288bf10 Mon Sep 17 00:00:00 2001 From: Denise Li Date: Wed, 10 Jul 2024 16:39:09 -0400 Subject: [PATCH] start of justfile --- Justfile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Justfile b/Justfile index a0e692c2f6..2a66046c80 100644 --- a/Justfile +++ b/Justfile @@ -173,4 +173,22 @@ debug *args: FTL_DEBUG=true just build ftl dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec "{{RELEASE}}/ftl" -- dev {{args}} & dlv_pid=$! - wait "$dlv_pid" \ No newline at end of file + 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. +otel-stream: + docker run \ + -p 4317:4317 \ + -p 55679:55679 \ + otel/opentelemetry-collector:0.104.0 + +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 +otel-dev *args: + export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317 + ftl dev {{args}}