Create a gist now

Instantly share code, notes, and snippets.

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
Owner

itsderek23 commented May 4, 2017

image

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