Open jdegoes opened 2 years ago
May I suggest another name? I mean this is an endpoint to expose metrics right? A health check might be in someone's domain something different. Like is the db connection alive. I would call the middleware exposeMetrics
or maybe publishMetrics
👍
going to attempt this
Is your feature request related to a problem? Please describe.
All of the metrics (ZIO, ZIO HTTP, + user metrics) can be exposed via an HTTP API, but currently, doing so requires depending on the project
zio-metrics-connectors
, which depends onzio-http
(an older version), and which launches a separate server on a separate port requiring its own configuration. This is inconvenient, as we want a single server and a healthcheck API available on this server.Describe the solution you'd like
Flip the dependency so that
zio-http
relies onzio-metrics-connectors
, andzio-metrics-connectors
is standalone, depending only onzio-core
. Using functionality inside this library,zio-http
can expose a healthcheck API:It's probable we should do this as an
HttpApp
(Http.publishMetrics
orHttp.exposeMetrics
). The user can then mix the route into their other routes in order to expose a healthcheck API (e.g.myApp ++ Http.publishMetrics
).Describe alternatives you've considered
Leaving the functionality in
zio-metrics-connectors
.