packages feed

hs-opentelemetry-api 0.0.3.0 → 0.0.3.1

raw patch · 3 files changed

+9/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for hs-opentelemetry-api +## 0.0.3.1++- `adjustContext` uses an empty context if one hasn't been created on the current thread yet instead of acting as a no-op.+ ## 0.0.2.1  - Doc enhancements
hs-opentelemetry-api.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           hs-opentelemetry-api-version:        0.0.3.0+version:        0.0.3.1 synopsis:       OpenTelemetry API for use by libraries for direct instrumentation or wrapper packages. description:    Please see the README on GitHub at <https://github.com/iand675/hs-opentelemetry/tree/main/api#readme> category:       OpenTelemetry, Telemetry, Monitoring, Observability, Metrics
src/OpenTelemetry/Context/ThreadLocal.hs view
@@ -55,6 +55,7 @@ -- import Control.Monad import System.IO.Unsafe import Prelude hiding (lookup)+import Control.Monad (void)  type ThreadContextMap = ThreadStorageMap Context @@ -111,7 +112,9 @@ -- -- @since 0.0.1.0 adjustContext :: MonadIO m => (Context -> Context) -> m ()-adjustContext = adjust threadContextMap+adjustContext f = liftIO $ do+  ctxt <- getContext+  void $ attachContext $ f ctxt  -- | Alter the context --