Update servant-prometheus library to get conforming metric names
Created by: hacklschorsch
@exarkun Please, as you always do, check this very carefully. This time I know even less what I am doing than usual.
Merge request reports
Activity
94 94 - | Create middleware which captures metrics for the payment server app. 95 95 makeMetricsMiddleware :: IO (Application -> Application) 96 96 makeMetricsMiddleware = do 97 meters <- makeMeters paymentServerAPI WithQuantiles 98 return $ monitorServant paymentServerAPI meters 97 meters <- register $ meters paymentServerAPI I was ready to be annoyed at servant-prometheus changing in a way that forces us to rely on global mutable state for metric registration. Then I dug into the prior implementation of
makeMeters
and of course I was thrilled to see that the way it worked was merely by callingregister
itself. Joy. At leastmeters
is pure and the global state is now readily apparent in our use of the library. That's a net improvement, I guess.
94 94 - | Create middleware which captures metrics for the payment server app. 95 95 makeMetricsMiddleware :: IO (Application -> Application) 96 96 makeMetricsMiddleware = do 97 meters <- makeMeters paymentServerAPI WithQuantiles 98 return $ monitorServant paymentServerAPI meters 97 meters <- register $ meters paymentServerAPI
Please register or sign in to reply