opentracing-http-client-0.3.0: OpenTracing instrumentation of http-client
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP.Client.OpenTracing

Synopsis

Documentation

httpTraced :: (HasCarrier Headers p, MonadOpenTracing r p m, MonadIO m) => SpanRefs -> Request -> Manager -> (Request -> Manager -> IO a) -> m (Traced a) Source #

>>> :{
mgr <- newManager defaultManagerSettings
rq1 <- parseRequest "http://service1.local/foo"
rq2 <- parseRequest "http://service2.local/bar"
traced (spanOpts "toplevel" mempty) $ \parent -> do
    rpc1 <- httpTraced (childOf parent) rq1 mgr httpLbs
    rpc2 <- httpTraced (childOf parent <> followsFrom (tracedSpan rpc1))
                       rq2 mgr httpLbs
    return [tracedResult rpc1, tracedResult rpc2]
:}