packages feed

hs-opentelemetry-instrumentation-conduit 0.0.1.1 → 0.1.0.0

raw patch · 5 files changed

+37/−20 lines, 5 filesdep ~hs-opentelemetry-apisetup-changedPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hs-opentelemetry-api

API changes (from Hackage documentation)

- OpenTelemetry.Instrumentation.Conduit: inSpan :: (MonadResource m, MonadUnliftIO m) => Tracer -> Text -> SpanArguments -> (Span -> ConduitM i o m a) -> ConduitM i o m a
+ OpenTelemetry.Instrumentation.Conduit: inSpan :: (MonadResource m, MonadUnliftIO m, HasCallStack) => Tracer -> Text -> SpanArguments -> (Span -> ConduitM i o m a) -> ConduitM i o m a

Files

ChangeLog.md view
@@ -1,3 +1,9 @@ # Changelog for hs-opentelemetry-instrumentation-conduit  ## Unreleased changes++## 0.1.0.0++### Breaking changes++- Use `HashMap Text Attribute` instead of `[(Text, Attribute)]` as attributes
Setup.hs view
@@ -1,2 +1,4 @@ import Distribution.Simple++ main = defaultMain
hs-opentelemetry-instrumentation-conduit.cabal view
@@ -1,20 +1,20 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack -name:           hs-opentelemetry-instrumentation-conduit-version:        0.0.1.1-description:    Please see the README on GitHub at <https://github.com/iand675/hs-opentelemetry/tree/main/instrumentation/conduit#readme>-homepage:       https://github.com/iand675/hs-opentelemetry#readme-bug-reports:    https://github.com/iand675/hs-opentelemetry/issues-author:         Ian Duncan-maintainer:     ian@iankduncan.com-copyright:      2021 Ian Duncan-license:        BSD3-license-file:   LICENSE-build-type:     Simple+name:               hs-opentelemetry-instrumentation-conduit+version:            0.1.0.0+description:        Please see the README on GitHub at <https://github.com/iand675/hs-opentelemetry/tree/main/instrumentation/conduit#readme>+homepage:           https://github.com/iand675/hs-opentelemetry#readme+bug-reports:        https://github.com/iand675/hs-opentelemetry/issues+author:             Ian Duncan, Jade Lovelace+maintainer:         ian@iankduncan.com+copyright:          2023 Ian Duncan, Mercury Technologies+license:            BSD3+license-file:       LICENSE+build-type:         Simple extra-source-files:     README.md     ChangeLog.md@@ -34,7 +34,7 @@   build-depends:       base >=4.7 && <5     , conduit-    , hs-opentelemetry-api ==0.0.3.*+    , hs-opentelemetry-api ==0.1.*     , text   default-language: Haskell2010 @@ -49,7 +49,7 @@   build-depends:       base >=4.7 && <5     , conduit-    , hs-opentelemetry-api ==0.0.3.*+    , hs-opentelemetry-api ==0.1.*     , hs-opentelemetry-instrumentation-conduit     , text   default-language: Haskell2010
src/OpenTelemetry/Instrumentation/Conduit.hs view
@@ -1,12 +1,19 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE OverloadedLists #-}+ module OpenTelemetry.Instrumentation.Conduit where+ import Conduit+import Control.Exception (SomeException, throwIO)+import Data.Text (Text)+import GHC.Stack (HasCallStack) import OpenTelemetry.Context.ThreadLocal import OpenTelemetry.Trace.Core hiding (getTracer)-import Data.Text (Text)-import Control.Exception (throwIO, SomeException) + inSpan-  :: (MonadResource m, MonadUnliftIO m) => Tracer+  :: (MonadResource m, MonadUnliftIO m, HasCallStack)+  => Tracer   -> Text   -> SpanArguments   -> (Span -> ConduitM i o m a)@@ -14,9 +21,10 @@ inSpan t n args f = do   ctx <- lift getContext   bracketP-    (createSpan t ctx n args)-    (`endSpan` Nothing) $ \span_ -> do+    (createSpanWithoutCallStack t ctx n $ addAttributesToSpanArguments callerAttributes args)+    (`endSpan` Nothing)+    $ \span_ -> do       catchC (f span_) $ \e -> do         liftIO $ do-          recordException span_ [] Nothing (e :: SomeException)+          recordException span_ [("exception.escaped", toAttribute True)] Nothing (e :: SomeException)           throwIO e
test/Spec.hs view
@@ -1,2 +1,3 @@+ main :: IO () main = putStrLn "Test suite not yet implemented"