AppSignal v0.0.6 Appsignal.Helpers

Helper functions to instrument your application

Summary

Functions

Execute the given function in start / finish event calls. See instrument/6

Execute the given function in start / finish event calls. See instrument/6

Execute the given function in start / finish event calls

Types

Functions

instrument(arg, name, title, function)

Specs

instrument(instrument_arg, String.t, String.t, function) :: any

Execute the given function in start / finish event calls. See instrument/6.

instrument(arg, name, title, body, function)

Specs

instrument(instrument_arg, String.t, String.t, String.t, function) :: any

Execute the given function in start / finish event calls. See instrument/6.

instrument(conn, name, title, body, body_format, function)

Specs

instrument(instrument_arg, String.t, String.t, String.t, integer, function) :: any

Execute the given function in start / finish event calls.

The result of the function’s execution is returned. For example, to instrument a backend HTTP call in a Phoenix controller, do the following:

import Appsignal.Helpers, only: [instrument: 4]

def index(conn, _params) do
    result = instrument(conn, "net.http", "Some slow backend call", fn() ->
                 Backend.get_result()
             end
    json conn, result
end