packages feed

lightstep-haskell 0.10.2 → 0.10.3

raw patch · 2 files changed

+9/−3 lines, 2 files

Files

lightstep-haskell.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4  name:           lightstep-haskell-version:        0.10.2+version:        0.10.3 synopsis:       LightStep OpenTracing client library description:    LightStep OpenTracing client library. Uses GRPC transport via proto-lens. category:       Tools
src/LightStep/HighLevel/IO.hs view
@@ -27,6 +27,7 @@ import Proto.Collector_Fields import System.IO.Unsafe import System.Timeout+import TextShow  {-# NOINLINE globalSharedMutableSpanStacks #-} globalSharedMutableSpanStacks :: MVar (HM.HashMap ThreadId [Span])@@ -45,18 +46,23 @@ withSpan opName action = withSpanAndTags opName [] action  withSpanAndTags :: forall m a. MonadIO m => MonadMask m => T.Text -> [(T.Text, T.Text)] -> m a -> m a-withSpanAndTags opName initialTags action =+withSpanAndTags opName initialTags action = do+   bytes_before <- liftIO getAllocationCounter    fst <$> generalBracket         (pushSpan opName initialTags)         (\sp exitcase -> do+          bytes_after <- liftIO getAllocationCounter+          let alloc = showt $ bytes_before - bytes_after           case exitcase of-            ExitCaseSuccess _ -> pure ()+            ExitCaseSuccess _ -> setTag "alloc" alloc             ExitCaseException ex -> do               setTags [+                ("alloc", alloc),                 ("error", "true"),                 ("error.message", (T.pack $ displayException ex))]             ExitCaseAbort -> do               setTags [+                ("alloc", alloc),                 ("error", "true"),                 ("error.message", "abort")]           popSpan sp)