Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
tchoutri committed Dec 29, 2024
2 parents a310d26 + 1dd67b9 commit 39b5bac
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,8 @@ source-repository-package
type: git
location: https://github.com/goodlyrottenapple/tasty-test-reporter
tag: b704130

source-repository-package
type: git
location: https://github.com/worm2fed/servant-prometheus
tag: 9f967b3b42b183653b91f0ba9097621797ad107d
2 changes: 2 additions & 0 deletions changelog.d/810
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
synopsis: Record more route duration metrics with prometheus
prs: #810
1 change: 1 addition & 0 deletions flora.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ library flora-web
, servant-client
, servant-client-core
, servant-openapi3
, servant-prometheus
, servant-server
, text
, text-display
Expand Down
8 changes: 4 additions & 4 deletions src/web/FloraWeb/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ import Network.Wai.Handler.Warp
)
import Network.Wai.Log qualified as WaiLog
import Network.Wai.Middleware.Heartbeat (heartbeatMiddleware)
import Network.Wai.Middleware.Prometheus qualified as P
import Network.Wai.Middleware.Prometheus qualified as WaiMetrics
import OddJobs.Endpoints qualified as OddJobs
import OddJobs.Job (startJobRunner)
import OddJobs.Types qualified as OddJobs
import Optics.Core
import Prometheus qualified as P
import Prometheus.Metric.GHC qualified as P
import Prometheus.Metric.Proc qualified as P
import Prometheus.Servant qualified as P
import Sel
import Servant
( Application
Expand Down Expand Up @@ -177,9 +178,8 @@ runServer appLogger floraEnv = do
$ heartbeatMiddleware
. loggingMiddleware
. const
$ P.prometheus
P.def
server
$ WaiMetrics.prometheus WaiMetrics.def
$ P.prometheusMiddleware P.defaultMetrics (Proxy @ServerRoutes) server

mkServer
:: Logger
Expand Down

0 comments on commit 39b5bac

Please sign in to comment.