New Relic Elixir Agent v1.4.0 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")

Link to this section Summary

Link to this section Functions

Link to this function delete!(url, headers \\ [], options \\ []) View Source
Link to this function delete(url, headers \\ [], options \\ []) View Source
Link to this function get!(url, headers \\ [], options \\ []) View Source
Link to this function get(url, headers \\ [], options \\ []) View Source
Link to this function head!(url, headers \\ [], options \\ []) View Source
Link to this function head(url, headers \\ [], options \\ []) View Source
Link to this function options!(url, headers \\ [], options \\ []) View Source
Link to this function options(url, headers \\ [], options \\ []) View Source
Link to this function patch!(url, body, headers \\ [], options \\ []) View Source
Link to this function patch(url, body, headers \\ [], options \\ []) View Source
Link to this function post!(url, body, headers \\ [], options \\ []) View Source
Link to this function post(url, body, headers \\ [], options \\ []) View Source
Link to this function put!(url, body \\ "", headers \\ [], options \\ []) View Source
Link to this function put(url, body \\ "", headers \\ [], options \\ []) View Source
Link to this function request!(method, url, body \\ "", headers \\ [], options \\ []) View Source
Link to this function request(method, url, body \\ "", headers \\ [], options \\ []) View Source