Skip to content

Commit

Permalink
applying PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanj-square committed Aug 15, 2024
1 parent 471dfb0 commit 5cd03b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

12 changes: 4 additions & 8 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ debug *args:
dlv_pid=$!
wait "$dlv_pid"

# otel is short for OpenTelemetry.
otel-grpc-port := `cat .env | grep "OTEL_GRPC_PORT" | sed 's/.*=//'`

# 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 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
Expand All @@ -205,14 +202,13 @@ otel-stream:
#!/bin/bash

docker run \
-p {{otel-grpc-port}}:{{otel-grpc-port}} \
-p ${OTEL_GRPC_PORT}:${OTEL_GRPC_PORT} \
-p 55679:55679 \
otel/opentelemetry-collector:0.104.0 2>&1 | sed 's/\([A-Z].* #\)/\
\1/g'

# Stop the docker container running otel.
otel-container-id := `docker ps -f ancestor=otel/opentelemetry-collector:0.104.0 | tail -1 | cut -d " " -f1`
grafana-container-id := `docker ps -f ancestor=grafana/otel-lgtm | tail -1 | cut -d " " -f1`

otel-stop:
docker stop "{{otel-container-id}}"
Expand All @@ -221,8 +217,8 @@ otel-stop:
otel-dev *args:
#!/bin/bash

export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:{{otel-grpc-port}}"
export OTEL_METRIC_EXPORT_INTERVAL=1000
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:${OTEL_GRPC_PORT}"
export OTEL_METRIC_EXPORT_INTERVAL=${OTEL_METRIC_EXPORT_INTERVAL}
# Uncomment this line for much richer debug logs
# export FTL_O11Y_LOG_LEVEL="debug"
ftl dev {{args}}
Expand All @@ -236,7 +232,7 @@ grafana:
docker compose up -d grafana

grafana-stop:
docker stop "{{grafana-container-id}}"
docker compose down grafana

storybook:
#!/bin/bash
Expand Down
2 changes: 2 additions & 0 deletions bin/hermit.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ env = {
"FTL_ENDPOINT": "http://localhost:8892",
"FTL_INIT_GO_REPLACE": "github.com/TBD54566975/ftl=${HERMIT_ENV}",
"FTL_SOURCE": "${HERMIT_ENV}",
"OTEL_GRPC_PORT": "4317",
"OTEL_HTTP_PORT": "4318",
"OTEL_METRIC_EXPORT_INTERVAL": "5000",
"PATH": "${HERMIT_ENV}/scripts:${HERMIT_ENV}/frontend/node_modules/.bin:${HERMIT_ENV}/extensions/vscode/node_modules/.bin:${PATH}",
}
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ services:
retries: 60
start_period: 80s
grafana:
profiles:
- infra
image: grafana/otel-lgtm
platform: linux/amd64
restart: unless-stopped
Expand Down

0 comments on commit 5cd03b4

Please sign in to comment.