Skip to content

Commit

Permalink
Add support for enabling tracing for single app servers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed Sep 19, 2023
1 parent 0b4e38f commit 4f262fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
1 change: 0 additions & 1 deletion ansible/_set_up_directories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
owner: deploy
group: deploy
become: true
when: update_dotenv is true

- name: Link .env to shared directory
ansible.builtin.file:
Expand Down
11 changes: 11 additions & 0 deletions ansible/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
ansible.builtin.include_tasks: "_assemble_deploy_assets.yml"
when: compile_assets is true

- name: Template .env file to shared directory
ansible.builtin.template:
src: "templates/dotenv.j2"
dest: "{{ project_root }}/shared/.env"
mode: "0755"
owner: deploy
group: deploy
become: true
when: update_dotenv is true
tags: [dotenv]

- name: Set up process management with supervisor
ansible.builtin.include_tasks: "_set_up_process_mgmt.yml"
tags:
Expand Down
10 changes: 5 additions & 5 deletions ansible/inventories/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ all:
internal_ip: "10.0.0.5"
dramatiq_threads: 2
dramatiq_processes: 3
sentry_trace_rate: 0
sentry_sample_rate: 0
app2.thegreenwebfoundation.org:
internal_ip: "10.0.0.4"
dramatiq_threads: 2
dramatiq_processes: 3
sentry_trace_rate: 0
sentry_sample_rate: 0
# TODO: once we have update the worker process names we can use app3 for serving production traffic
# letting us decommission some of the older app servers
app3.thegreenwebfoundation.org:
internal_ip: "10.0.0.6"
dramatiq_threads: 1
dramatiq_processes: 1
sentry_trace_rate: 1
sentry_sample_rate: 1
app4.thegreenwebfoundation.org:
internal_ip: "10.0.0.7"
dramatiq_threads: 2
dramatiq_processes: 3
sentry_trace_rate: 0
sentry_sample_rate: 0

vars:
tgwf_stage: "prod"
Expand All @@ -33,7 +33,7 @@ all:
supervisor_user: "deploy"
supervisor_gunicorn_app: "web_{{ tgwf_stage }}"
supervisor_worker_job: "worker_{{ tgwf_stage }}"
port: 9000
gunicorn_port: 9000

# you can set child groups too
children:
Expand Down
2 changes: 1 addition & 1 deletion greenweb/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
# activate the django specific integrations for sentry
integrations=[DjangoIntegration()],
# We assume that is a user is logged in, we want to be able
Expand Down

0 comments on commit 4f262fd

Please sign in to comment.