Skip to content

Commit 434a3ba

Browse files
authored
Merge pull request #264 from ercpe/document-lazy-apps
2 parents f9e9afc + 60716cc commit 434a3ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

documentation/exports.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ This will make Django-Prometheus try to export /metrics on port
7676
You can then configure Prometheus to collect metrics on as many
7777
targets as you have workers, using each port separately.
7878

79+
This approach requires the application to be loaded into each child process.
80+
uWSGI and Gunicorn typically load the application into the master process before forking the child processes.
81+
Set the [lazy-apps option](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#lazy-apps) to `true` (uWSGI)
82+
or the [preload-app option](https://docs.gunicorn.org/en/stable/settings.html#preload-app) to `false` (Gunicorn)
83+
to change this behaviour.
84+
85+
7986
## Exporting /metrics in a WSGI application with multiple processes globally
8087

8188
In some WSGI applications, workers are short lived (less than a minute), so some

0 commit comments

Comments
 (0)