metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.06k stars 145 forks source link

Set plain/text Content-Type for prometheus exporter #496

Closed snaggen closed 1 week ago

snaggen commented 2 weeks ago

Playing around with different tools to view metrics, I found that some tool complained about not having Content-Type text/plain. So this PR fixes that.

sgrebnov commented 1 week ago

Encountered with the same issue when using this crate and Datadog

sgrebnov commented 1 week ago

I've manually applied this fix and confirmed that the Prometheus exporter is now compliant with the DataDog Prometheus scraper.

Prometheus Exposition Format and Content-Type header: https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format

tobz commented 1 week ago

Seems reasonable to me! 👍🏻

tobz commented 4 days ago

Released as metrics-exporter-prometheus@v0.15.3.

Thanks again for your contribution!