Open dtaniwaki opened 3 years ago
Thanks for reporting this @dtaniwaki , I hadn't considered these differences when running locally vs in prod. We can make it non-underscored (though should leave the old version there as well for backwards compatibility). Do you think just exposing it as is makes sense, or is there a better pattern that may be more useful here? Thinking of maybe something like ConnexionPrometheusMetrics.create_json_response_converter()
?
I think we're not sure if the default content type is JSON for all the users.
So, I think the following 2 methods satisfies any user's usecases.
ConnexionPrometheusMetrics.context_type(content_type)
ConnexionPrometheusMetrics.create_response_converter(default_mimetype)
I have a Connexion app which runs by
flask run
directly in the dev env, and with gunicorn in the production env, so I can't directly useConnexionPrometheusMetrics
. I made the following code to make this package work with Connexion in both env.For direct run,
For gunicorn,
It looks fine, but the method to create a response converter for
ConnexionPrometheusMetrics
is_
-prefixed, which should indicate that using it directly is not supported. Could you consider making it no_
prefixed and officially support using it from anywhere?