Skip to content

Commit

Permalink
Merge pull request #129 from kojiromike/choose-your-own-adventure
Browse files Browse the repository at this point in the history
Support Various Prometheus Client Versions
  • Loading branch information
rycus86 committed Apr 7, 2022
2 parents 02b2ea3 + 943731c commit d423412
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion prometheus_flask_exporter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
from flask import request, make_response, current_app
from flask.views import MethodViewType
from prometheus_client import Counter, Histogram, Gauge, Summary
from prometheus_client.exposition import choose_formatter
try:
# prometheus-client >= 0.14.0
from prometheus_client.exposition import choose_formatter
except ImportError:
# prometheus-client < 0.14.0
from prometheus_client.exposition import choose_encoder as choose_formatter

from werkzeug.serving import is_running_from_reloader

if sys.version_info[0:2] >= (3, 4):
Expand Down

0 comments on commit d423412

Please sign in to comment.