rycus86 / prometheus_flask_exporter

Prometheus exporter for Flask applications
https://pypi.python.org/pypi/prometheus-flask-exporter
MIT License
642 stars 162 forks source link

`prometheus_multiproc_dir` env var to switch to upper case #97

Closed qbiqing closed 2 years ago

qbiqing commented 3 years ago

Following https://github.com/prometheus/client_python/pull/624 and the release of prometheus-client v0.10.0, continuing to use prometheus_multiproc_dir gives a deprecation warning. However, PROMETHEUS_MULTIPROC_DIR is not yet recognized by prometheus_flask_exporter.

Error:

/usr/local/lib/python3.8/site-packages/prometheus_flask_exporter/__init__.py:214: in for_app_factory
    return cls(app=None, **kwargs)
/usr/local/lib/python3.8/site-packages/prometheus_flask_exporter/multiprocess.py:183: in __init__
    super(GunicornInternalPrometheusMetrics, self).__init__(app=app, **kwargs)
/usr/local/lib/python3.8/site-packages/prometheus_flask_exporter/multiprocess.py:51: in __init__
    _check_multiproc_env_var()
/usr/local/lib/python3.8/site-packages/prometheus_flask_exporter/multiprocess.py:25: in _check_multiproc_env_var
    raise ValueError('env prometheus_multiproc_dir is not set or not a directory')
E   ValueError: env prometheus_multiproc_dir is not set or not a directory
rycus86 commented 3 years ago

Thanks for reporting @qbiqing ! Sounds like this could be a relatively easy fix. I can have a look in a week or so, or I can review a PR if it's more urgent (sounds like it's only a warning at the moment).

qbiqing commented 3 years ago

Created PR: https://github.com/rycus86/prometheus_flask_exporter/pull/98 First time contributing to this repo so do let me know if anything else is needed!

tgpfeiffer commented 2 years ago

I think this was fixed in #98 and could be closed?

rycus86 commented 2 years ago

Yes, you're right, thanks for the ping!