Ptrskay3 / axum-prometheus

🔎 Prometheus metrics middleware for Axum
MIT License
62 stars 9 forks source link

UNIX domain socket are not supported by default #63

Open RaitoBezarius opened 3 months ago

RaitoBezarius commented 3 months ago

It seems that the default handler uses PrometheusBuilder::new and uses a HTTP listener which doesn't work when Axum uses a UDS listener which should use the UDS listen for the Prometheus builder.

I'm not super knowledgeable about all that stuff so I'm not sure if there's a way to make this work by default out of the box without writing a MakeDefaultHandle that tries to detect if there's a UDS listen or a HTTP listen and switch the instantiation based on that.

Ptrskay3 commented 3 months ago

I don't think this is something we plan to support out of the box.

There're a couple of ways implement this on your own — for instance with the latest addition of BaseMetricLayer you can setup your exporter however you like, completely decoupled from the rest this crate. I don't think I'll ever plan to work on this, but if it's really important to you (or for anybody else) to support this by default, I'll accept PRs.