Skip to content
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

MTP-1921: Add Azure Application Insights request tracing and logging #587

Merged
merged 4 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Have uWSGI start workers lazily …such that each process loads it's ow…
…n complete application rather than forking the master. This now requires the spooler to setup django.

Lazy apps are needed if telemetry is to be sent to Azure Application Insights: the `opencensus` library starts a background thread on launch to transport telemetry to Azure, but if uWSGI loads the application and _then_ forks, this thread is no longer accessible from the new process.
  • Loading branch information
ushkarev committed Aug 3, 2022
commit 70c39b4290048b54ad5e6d57bf0a6ca6f71c3285
2 changes: 1 addition & 1 deletion cashbook.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[uwsgi]
procname = uwsgi_%n
die-on-term = 1
lazy-apps = 0
lazy-apps = 1
vacuum = 1

master = true
Expand Down
2 changes: 2 additions & 0 deletions mtp_cashbook/tasks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import django
from mtp_common.spooling import autodiscover_tasks

django.setup()
autodiscover_tasks()