Skip to content

Commit

Permalink
change choose_encoder to choose_formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
CorinneKelly authored Apr 5, 2022
1 parent 243502b commit 8d27fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus_flask_exporter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
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_encoder
from prometheus_client.exposition import choose_formatter
from werkzeug.serving import is_running_from_reloader

if sys.version_info[0:2] >= (3, 4):
Expand Down Expand Up @@ -278,7 +278,7 @@ def prometheus_metrics():
if 'PROMETHEUS_MULTIPROC_DIR' in os.environ or 'prometheus_multiproc_dir' in os.environ:
multiprocess.MultiProcessCollector(registry)

generate_latest, content_type = choose_encoder(request.headers.get("Accept"))
generate_latest, content_type = choose_formatter(request.headers.get("Accept"))
headers = {'Content-Type': content_type}
return generate_latest(registry), 200, headers

Expand Down

0 comments on commit 8d27fea

Please sign in to comment.