From 669e969b97d1c8692828b90a400a28c78a70bf94 Mon Sep 17 00:00:00 2001 From: Florian Sesser <florian@private.storage> Date: Tue, 29 Jun 2021 11:43:19 +0000 Subject: [PATCH] Update servant-prometheus to a branch with conforming metric names Got it to compile! This could be chinese for all I know. The author of the library used says the tests currently fail. This might be a problem with how Nix handles things. Also, client-side quantile computation is not available anymore. We'll just user server-computed histograms instead. --- PaymentServer.cabal | 2 +- nix/servant-prometheus.nix | 6 +++--- src/PaymentServer/Server.hs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PaymentServer.cabal b/PaymentServer.cabal index 134ce45..3297150 100644 --- a/PaymentServer.cabal +++ b/PaymentServer.cabal @@ -1,5 +1,5 @@ name: PaymentServer -version: 0.1.0.0 +version: 0.1.1.0 synopsis: Coordinate entities for the purchase of PrivateStorage.io vouchers. -- description: homepage: https://github.com/privatestorageio/PaymentServer#readme diff --git a/nix/servant-prometheus.nix b/nix/servant-prometheus.nix index fb01328..547f290 100644 --- a/nix/servant-prometheus.nix +++ b/nix/servant-prometheus.nix @@ -42,7 +42,7 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: flags = {}; package = { specVersion = "1.10"; - identifier = { name = "servant-prometheus"; version = "0.1.0.0"; }; + identifier = { name = "servant-prometheus"; version = "0.2.0.0"; }; license = "BSD-3-Clause"; copyright = ""; maintainer = "Alex Mason <axman6@gmail.com>, Jack Kelly <jack.kelly@data61.csiro.au>"; @@ -106,7 +106,7 @@ in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: } // { src = (pkgs.lib).mkDefault (pkgs.fetchgit { url = "https://github.com/PrivateStorageio/servant-prometheus.git"; - rev = "ec21c5ed50e6f6f8e52916ce71cd68fcd0166cad"; + rev = "b1207d687aeb48bd035f986e88287391e4937e23"; sha256 = "0lswszfs52x5rpf7lj46iv77zghcbr4d05dwssi63yzjll1ixizd"; }); - } \ No newline at end of file + } diff --git a/src/PaymentServer/Server.hs b/src/PaymentServer/Server.hs index 8842dab..e811f2c 100644 --- a/src/PaymentServer/Server.hs +++ b/src/PaymentServer/Server.hs @@ -23,10 +23,10 @@ import Servant , (:>) , (:<|>)((:<|>)) ) +import Prometheus (register) import Servant.Prometheus - ( MeasureQuantiles(WithQuantiles) - , monitorServant - , makeMeters + ( monitorServant + , meters ) import Web.Stripe.Client @@ -94,5 +94,5 @@ paymentServerApp corsOrigins stripeConfig issuer = -- | Create middleware which captures metrics for the payment server app. makeMetricsMiddleware :: IO (Application -> Application) makeMetricsMiddleware = do - meters <- makeMeters paymentServerAPI WithQuantiles - return $ monitorServant paymentServerAPI meters + meters <- register $ meters paymentServerAPI + return $ monitorServant meters -- GitLab