Skip to content

Commit

Permalink
api: STATSD_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Apr 17, 2024
1 parent d267096 commit ceffcbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions mpcontribs-api/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ sleep $zzz
pmgrc=$HOME/.pmgrc.yaml
[[ ! -e $pmgrc ]] && echo "PMG_DUMMY_VAR: dummy" >$pmgrc

CMD='gunicorn mpcontribs.api:create_app()'
STATS_ARG=""
SERVER_APP="mpcontribs.api:create_app()"
WAIT_FOR="wait-for-it.sh $JUPYTER_GATEWAY_HOST -q -t 50"

if [[ -n "$DD_TRACE_HOST" ]]; then
wait-for-it.sh $DD_TRACE_HOST -q -s -t 10 && CMD="ddtrace-run $CMD"
wait-for-it.sh $DD_TRACE_HOST -q -s -t 10 && STATS_ARG="--statsd-host $DD_AGENT_HOST:8125"
fi

exec wait-for-it.sh $JUPYTER_GATEWAY_HOST -q -t 50 -- $CMD
if [[ -n "$STATS_ARG" ]]; then
exec $WAIT_FOR -- ddtrace-run gunicorn $STATS_ARG $SERVER_APP
else
exec $WAIT_FOR -- gunicorn $SERVER_APP
fi
1 change: 0 additions & 1 deletion mpcontribs-kernel-gateway/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ if [[ -n "$DD_TRACE_HOST" ]]; then
wait-for-it.sh $DD_TRACE_HOST -q -s -t 10 && CMD="ddtrace-run $CMD"
fi

echo $CMD
exec $CMD --KernelGatewayApp.log_format='%(asctime)s,%(msecs)03d %(levelname)s [%(name)s] [%(module)s:%(lineno)d] - %(message)s'

0 comments on commit ceffcbc

Please sign in to comment.