New Relic Elixir Agent v1.6.2 NewRelic.Instrumented.HTTPoison View Source
To track outbound requests as part of a Distributed Trace, an additional request
header needs to be added. Simply alias this module and use HTTPoison
as normal,
all your requests will be automatically instrumented.
alias NewRelic.Instrumented.HTTPoison
HTTPoison.get("http://www.example.com")
This module mirrors the interface of HTTPoison
Notes:
- If you need to pattern match against a result, note that the structs that come back are
the original
HTTPoison
structs.
# Match against the full struct name
{:ok, %Elixir.HTTPoison.Response{body: body}} = HTTPoison.get("http://www.example.com")
# Match against it with a raw map
{:ok, %{body: body}} = HTTPoison.get("http://www.example.com")