packages feed

instana-haskell-trace-sdk 0.10.0.0 → 0.10.1.0

raw patch · 9 files changed

+17/−19 lines, 9 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Changelog for instana-haskell-trace-sdk +## 0.10.1.0+- Fix: Remove obsolete check for Server header when connecting to the Instana host agent.+ ## 0.10.0.0 - Feature: Upgrade support for the W3C trace context specification to level 2. 
README.md view
@@ -15,7 +15,7 @@  ``` extra-deps:-- instana-haskell-trace-sdk-0.10.0.0+- instana-haskell-trace-sdk-0.10.1.0 ```  Depending on the stack resolver you use, you might also need to add `aeson-extra` to your extra-deps:
instana-haskell-trace-sdk.cabal view
@@ -1,5 +1,5 @@ name:           instana-haskell-trace-sdk-version:        0.10.0.0+version:        0.10.1.0 synopsis:       SDK for adding custom Instana tracing support to Haskell applications. description:    Please also see the README on Github at <https://github.com/instana/haskell-trace-sdk#readme> homepage:       https://www.instana.com/
src/Instana/SDK/Internal/AgentConnection/AgentHostLookup.hs view
@@ -13,11 +13,10 @@ import qualified Control.Concurrent.STM                           as STM import           Control.Exception                                (SomeException,                                                                    catch)-import           Data.ByteString.Char8                            (unpack) import           Data.Char                                        (isSpace) import qualified Data.List                                        as List import qualified Network.HTTP.Client                              as HTTP-import qualified Network.HTTP.Types.Header                        as Header+import qualified Network.HTTP.Types.Status                        as Status import           System.Exit                                      (ExitCode (ExitSuccess)) import           System.Log.Logger                                (debugM) import           System.Process                                   as Process@@ -114,7 +113,6 @@   -> IO (Either String SuccessfullHost) tryHost context host port = do   let-    expectedServerHeader = "Instana Agent"     manager = InternalContext.httpManager context     agentRootUrl = URL.mkHttp host port ""   debugM instanaLogger $ "Trying to reach agent at " ++ show agentRootUrl@@ -125,17 +123,14 @@     (do       response <- agentRootAction       let-        headers = HTTP.responseHeaders response-        serverHeaderTuple = List.find (\(h, _) -> h == Header.hServer) headers-        serverHeaderValue = (unpack . snd) <$> serverHeaderTuple-      if serverHeaderValue == Just expectedServerHeader+        httpStatus = Status.statusCode $ HTTP.responseStatus response+      if httpStatus >= 200 && httpStatus < 300       then do         return $ Right (host, port)       else do         return $ Left $           "Host at " ++ show agentRootUrl ++ " did not respond with " ++-          "expected Server header (" ++ expectedServerHeader ++-          ") but with: " ++ show serverHeaderValue+          "expected HTTP status but with: " ++ show httpStatus     )     (\e -> do       let
src/Instana/SDK/Internal/Logging.hs view
@@ -197,6 +197,7 @@     "INFO"      -> Just INFO     "NOTICE"    -> Just NOTICE     "WARNING"   -> Just WARNING+    "WARN"      -> Just WARNING     "ERROR"     -> Just ERROR     "CRITICAL"  -> Just CRITICAL     "ALERT"     -> Just ALERT
test/agent-stub/Instana/SDK/AgentStub/API.hs view
@@ -14,7 +14,7 @@  type API =        -- GET /-       Get '[JSON] (Headers '[Header "Server" String] NoContent)+       Get '[JSON] NoContent         -- PUT /com.instana.plugin.haskell.discovery   :<|> "com.instana.plugin.haskell.discovery"
test/agent-stub/Instana/SDK/AgentStub/Server.hs view
@@ -10,8 +10,7 @@ import           Data.STRef                              (modifySTRef,                                                           readSTRef) import           Data.Time.Clock.POSIX                   (getPOSIXTime)-import           Servant                                 (Header, Headers,-                                                          NoContent (NoContent),+import           Servant                                 (NoContent (NoContent),                                                           err404, err503,                                                           (:<|>) (..)) import qualified Servant@@ -50,9 +49,9 @@  :<|> StubServer.stubServer recorders  -getRoot :: Servant.Handler (Headers '[Header "Server" String] NoContent)+getRoot :: Servant.Handler NoContent getRoot =-  return $ Servant.addHeader "Instana Agent" NoContent+  return $ NoContent   putDiscovery ::
test/integration/Instana/SDK/IntegrationTest/Connection.hs view
@@ -13,9 +13,9 @@  import           Instana.SDK.AgentStub.TraceRequest     (From (..), Span) import qualified Instana.SDK.AgentStub.TraceRequest     as TraceRequest-import qualified Instana.SDK.IntegrationTest.HttpHelper as HttpHelper import           Instana.SDK.IntegrationTest.HUnitExtra (applyLabel,                                                          assertAllIO, failIO)+import qualified Instana.SDK.IntegrationTest.HttpHelper as HttpHelper import qualified Instana.SDK.IntegrationTest.Suite      as Suite import qualified Instana.SDK.IntegrationTest.TestHelper as TestHelper 
test/integration/Instana/SDK/IntegrationTest/HttpHelper.hs view
@@ -41,8 +41,8 @@ --    simultaneously -- 2) The agent stub might not yet be up when the Instana SDK in the app under --    test starts to look for an agent (which is a perfectly normal situation---    and should shouldn't not be a problem as the SDK will retry with to find---    an agent to connect to with fibonacci backoff).+--    and should shouldn't not be a problem as the SDK will retry to find an+--    agent to connect to with fibonacci backoff). -- 3) When this happens, the first attempt to talk to 127.0.0.1:1302 fails. -- 4) Next, the SDK attempts to talk to an agent over the default gateway. -- 5) This never happens locally (at least not on MacOS), as there is no