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

Inconsistent metrics with Django + uwsgi #110

rhazdon opened this issue Jul 15, 2019 · 2 comments


Copy link

commented Jul 15, 2019


First of all: Thanks for the work and effort for the project.

In my last app I noticed a relatively strange behavior: Counting metrics is not consistent.

As an example I have the metric django_http_responses_total_by_status_total. This works as expected and then suddenly drops a few hundred to a thousand counts. With the next request on /metrics the count returns to the value before and keeps on counting.

As caching backend I use a Redis.

This is how the query django_http_requests_total_by_method_total{job="my_app"} looks like:

Since I don't want to exclude that it has something to do with my uwsgi configuration, here this one again.

Does anyone have any idea what might be going on here?

master = true

username = www-data
chdir = /opt/app/

env =
env = SENTRY_ENVIRONMENT=production
module = app.wsgi:application

pidfile = /var/run/app/
socket = /var/run/app/uwsgi.sock
chown-socket = www-data:www-data
chmod-socket = 660

vacuum = true
die-on-term = true
emperor = true
enable-threads = true

processes = 2
threads = 4
workers = 2

This comment has been minimized.

Copy link

commented Jul 16, 2019

This is another sample.

Query: sum(django_http_responses_total_by_status_total{job="my_app"})



This comment has been minimized.

Copy link

commented Jul 20, 2019

I found my issue. There were two options missing in my config:

env = prometheus_multiproc_dir=prometheus_multi
lazy-apps = true

Now it works like a charm. :)

@rhazdon rhazdon closed this Jul 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.