Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scout HTTPoison Instrumentation
# Instruments HTTPoison calls.
#
# Example usage:
#
# defmodule Demo.Web.PageController do
# use Demo.Web, :controller
# alias ScoutApm.HTTPoison
# def index(conn, _params) do
# HTTPoison.get("https://cnn.com")
# HTTPoison.post("https://cnn.com", "")
# HTTPoison.get!("http://localhost:4567")
# render conn, "index.html"
# end
# end
defmodule ScoutApm.HTTPoison do
use HTTPoison.Base
import ScoutApm.Tracing
def request(method, url, body \\ "", headers \\ [], options \\ []) do
timing("HTTP", method) do
update_desc(url)
super(method, url, body, headers, options)
end
end
end
@itsderek23

This comment has been minimized.

Show comment
Hide comment
Owner

itsderek23 commented May 4, 2017

image

@thiagogsr

This comment has been minimized.

Show comment
Hide comment
@thiagogsr

thiagogsr Feb 6, 2018

Hi

How to use it together %HTTPoison.Response{} and %HTTPoison.Error{} structs?

thiagogsr commented Feb 6, 2018

Hi

How to use it together %HTTPoison.Response{} and %HTTPoison.Error{} structs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment