nlopes / actix-web-prom

Actix-web middleware to expose Prometheus metrics
MIT License
89 stars 56 forks source link

Export metrics with content-type text/plain #34

Closed dejankos closed 3 years ago

dejankos commented 3 years ago

Hi,

Exported metrics for some reason have Content-type header "application/json" - I've tested this on several projects using actix-web 3 and actix-web-prom 0.5.0. It should be "text/plain; version=0.0.4" with charset "utf-8" as described in prometheus docs here: https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format

nlopes commented 3 years ago

Thank you so much for doing this. Would you be so kind as to move your two imports to the top? I think the other ones where you added are there due to being used only after the import (or perhaps they were added there by mistake).

dejankos commented 3 years ago

Sure np - imports moved to the top. Those other two are there by mistake and can be moved in a separate pr.