Consider /foos/1 vs /foos/2: grouping naively by url makes these two
errors when we wanted them to be one. This can’t be solved without knowledge
of the routing system, so we can’t do it from within this library as-is.
Therefore, we’ve reverted the feature for now.
Remove Freckle.App.Datadog modules for Freckle.App.Stats equivalents
It’s not a drop-in, but the required changes should be mechanical:
Instead of HasDogStats{Client,Tags}, implement a single HasStatsClient
Instead of mkStatsClient use withStatsClient (the new style of runApp
had will enable that)
Use tagged instead of extra arguments to metric sends
Move to the new Rts, Gauge, and Middleware.Stats modules
Change signature of runApp and withApp
Instead of passing a loaded App (or a function that loads an App) to
runApp and withApp, you should now pass a function that takes a function
and calls it on the loaded App.
This is necessary for apps that hold onto values that require cleanup, like
withStatsClient.
-- This doesn't work
loadApp :: IO App
loadApp = do
-- ...
withStatsClient $ \appStatsClient -> do
-- ???
-- This does
loadApp :: (App -> IO a) -> IO a
loadApp f = do
-- ...
withStatsClient $ \appStatsClient -> do
f App { .. }
The old form can be trivially converted to the new form like so,
loadApp :: (App -> IO a) -> IO a
loadApp f = f =<< loadApp'
loadApp' :: IO App
loadApp' = -- old code
Add functions that check properties that we like to commonly test.
Use Env.kept with parsing that occurs in makePostgresPool
This ensure all PG variables are kept in the environment after parsing, to
again match pre-v1.1 behavior.
If you would prefer not to keep these variables, parse them yourself (e.g.
with envParseDatabaseConf) and use makePostgresPoolWith.
Add Freckle.App.Env.kept to re-define a Parser so that all variables are
kept after reading. Not doing this can break tests if you are re-parsing the
environment for each example.
Replace Env.parse f with Env.parse f $ Env.kept to recover how this module
behaved prior to v1.1.
Remove Freckle.App.Logging, integrate with blammo instead.
This will require the following end-user changes:
Remove HasLogging instance and add HasLogger
This will require storing a Logger on your runtime App type, instead of
a LogLevel (et al) in your static AppSettings type. (Or move to
runSimpleLoggingT.)
Support seconds or milliseconds in PGSTATEMENTTIMEOUT
NOTE: We consider this a non-breaking change because the environment variable
interface is backwards-compatible. By normal Haskell rules, it would be major
since it’s changing the type of something exported.