-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sentry tracing #517
Changes from 3 commits
9e1298d
15cecc9
fa91871
8d472ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# supervisor can only control processes it started itself. | ||
# So we need to use exec to replace the parent shell script process | ||
# that starts pipenv | ||
exec python -m pipenv run gunicorn greenweb.wsgi -b {{ internal_ip }}:$PORT -t 300 -c gunicorn.conf.py --statsd-host=10.0.0.2:9125 --statsd-prefix=member.app | ||
exec python -m pipenv run gunicorn greenweb.wsgi -b {{ internal_ip }}:{{ gunicorn_port }} -t 300 -c gunicorn.conf.py --statsd-host=10.0.0.2:9125 --statsd-prefix=member.app | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
# {{ ansible_managed }} | ||
# Last run: {{ template_run_date }} | ||
|
||
[supervisord] | ||
environment=LC_ALL='en_US.UTF-8',LANG='en_US.UTF-8' | ||
|
||
[program:{{ supervisor_gunicorn_app }}] | ||
directory=/var/www/{{ tgwf_domain_name }}.thegreenwebfoundation.org/current/ | ||
numprocs=1 | ||
command=bash ./run_gunicorn.sh | ||
process_name=%(process_num)02d | ||
environment=PORT=90%(process_num)02d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't scale with supervisord - gunicorn has good support for forking subprocesses and threads, and using those to control concurrency, and resource usage, so we do it there instead. |
||
autostart=true | ||
autorestart=true | ||
stopsignal=QUIT | ||
user={{ supervisor_user }} | ||
|
||
stdout_logfile=%(program_name)s_%(process_num)02d_.log | ||
stderr_logfile=%(program_name)s_%(process_num)02d_.error.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ | |
# set our identifying credentials | ||
dsn=sentry_dsn, | ||
# Set traces_sample_rate. | ||
traces_sample_rate=sentry_sample_rate, | ||
traces_sample_rate=float(sentry_sample_rate), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sentry seems to expect a float, not a string, so we coerce accordingly. |
||
# activate the django specific integrations for sentry | ||
integrations=[DjangoIntegration()], | ||
# We assume that is a user is logged in, we want to be able | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set the port explicitly because this allows us to run production and staging apps on the same machine, without port clashes