Skip to content

add multiprocess capability to PROMETHEUS_METRICS_EXPORT_PORT and _RANGE; fix PROMETHEUS_METRICS_EXPORT_ADDRESS=ANY#502

Open
neeels wants to merge 2 commits into
django-commons:masterfrom
neeels:master
Open

add multiprocess capability to PROMETHEUS_METRICS_EXPORT_PORT and _RANGE; fix PROMETHEUS_METRICS_EXPORT_ADDRESS=ANY#502
neeels wants to merge 2 commits into
django-commons:masterfrom
neeels:master

Conversation

@neeels

@neeels neeels commented Feb 19, 2026

Copy link
Copy Markdown

running django under uwsgi, this enables correct stats exported via a separate port:

  • because of multiple python processes, django under uwsgi needs a PROMETHEUS_MULTIPROC_DIR
  • this was only supported for the django view export, so before this patch, django users were forced to export a view on the public web server to export stats (and then guard that URL via nginx.... ugly)
  • after these patches, setting PROMETHEUS_MULTIPROC_DIR also has an effect on PROMETHEUS_METRICS_EXPORT_PORT as well as PROMETHEUS_METRICS_EXPORT_PORT_RANGE.
  • and after this patch, setting PROMETHEUS_METRICS_EXPORT_ADDRESS="" and =None safely have the same effect of using ANY interface, instead of requiring ="" for a port range and =None for a single port, so confusing.

Apparently ANY is achieved via "" with a port range, and via None with a
single port. Make sure that any empty PROMETHEUS_METRICS_EXPORT_ADDRESS
always defaults to the correct value for ANY interface as in 0.0.0.0.
@neeels

neeels commented Feb 24, 2026

Copy link
Copy Markdown
Author

this accidentally / coincidentally is similar to PR 283, no idea which patch is better.

But apparently maintenance of this repository has ceased, if this problem has not been solved for > 1 year?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant