Skip to content

Commit

Permalink
Add datadog tracing (#79)
Browse files Browse the repository at this point in the history
Co-authored-by: mprince_ramp <mprince@ramp.com>
  • Loading branch information
mprince and mprince_ramp committed Feb 16, 2024
1 parent 535fce4 commit e034430
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/bin/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def get_status(b):
ENABLE_API = get_bool("LEEK_ENABLE_API")
ENABLE_AGENT = get_bool("LEEK_ENABLE_AGENT")
ENABLE_WEB = get_bool("LEEK_ENABLE_WEB")
ENABLE_DDTRACE = get_bool("LEEK_ENABLE_DDTRACE")
LEEK_ES_URL = os.environ.get("LEEK_ES_URL", "http://0.0.0.0:9200")
LEEK_ES_IM_ENABLE = get_bool("LEEK_ES_IM_ENABLE", default="false")
LEEK_ES_IM_SLACK_WEBHOOK_URL = os.environ.get("LEEK_ES_IM_SLACK_WEBHOOK_URL")
Expand Down
11 changes: 9 additions & 2 deletions app/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@ SERVICE=$1
ENABLE_API=$(echo "${LEEK_ENABLE_API-false}" | tr '[:upper:]' '[:lower:]')
ENABLE_AGENT=$(echo "${LEEK_ENABLE_AGENT-false}" | tr '[:upper:]' '[:lower:]')
ENABLE_WEB=$(echo "${LEEK_ENABLE_WEB-false}" | tr '[:upper:]' '[:lower:]')
ENABLE_DDTRACE=$(echo "${LEEK_ENABLE_DDTRACE-false}" | tr '[:upper:]' '[:lower:]')

case ${SERVICE} in

"api")
if [ "${ENABLE_API}" = true ]; then
exec gunicorn --reload -c /opt/app/leek/api/server/gunicorn.py leek.api.server.wsgi:app
if [ "${ENABLE_DDTRACE}" = true ]; then
exec ddtrace-run gunicorn --reload -c /opt/app/leek/api/server/gunicorn.py leek.api.server.wsgi:app
else
exec gunicorn --reload -c /opt/app/leek/api/server/gunicorn.py leek.api.server.wsgi:app
fi
;;

"agent")
if [ "${ENABLE_AGENT}" = true ]; then
exec python -m leek.agent.agent
if [ "${ENABLE_DDTRACE}" = true ]; then
exec ddtrace-run python -m leek.agent.agent
else
exec python -m leek.agent.agent
fi
;;

Expand Down
1 change: 1 addition & 0 deletions app/leek/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ printy==2.1.1
supervisor==4.2.1
ciso8601==2.1.3
werkzeug==2.1.2
ddtrace==2.6.2

# Additional for agent
kombu==5.2.4
Expand Down

0 comments on commit e034430

Please sign in to comment.