Skip to content
Snippets Groups Projects

Update servant-prometheus library to get conforming metric names

Merged Administrator requested to merge github/fork/hacklschorsch/rename-metrics into main

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: hacklschorsch

    Oh no! I can't access circleCI! Some one else will have to fix the tests!

  • @hacklschorsch I changed the servant-prometheus revision to git rev-parse flo/metric-names in stack.yaml and then re-generated the nix packaging. CI looks happier now.

  • 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 calling register itself. Joy. At least meters is pure and the global state is now readily apparent in our use of the library. That's a net improvement, I guess.

  • This seems good to me. I merged the servant-prometheus PR and made one more git rev update to the packaging here (nominal only, since the content of the branch revision and master revision is identical).

  • Administrator
    Administrator @root started a thread on commit c62c5b49
  • 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
  • Created by: hacklschorsch

    This seems good to me.

    Would you like to merge it then? You merged the other PR (some docs cosmetics) only so far.

  • Please register or sign in to reply
    Loading