Appsignal.Instrumentation.instrument

You're seeing just the function instrument, go back to Appsignal.Instrumentation module for more information.

Specs

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

Instrument a function.

def call do
  Appsignal.instrument("foo.bar", fn ->
    :timer.sleep(1000)
  end)
end

When passing a function that takes an argument, the function is called with the created span to allow adding extra information.

def call(params) do
  Appsignal.instrument("foo.bar", fn span ->
    Appsignal.Span.set_sample_data(span, "params", params)
    :timer.sleep(1000)
  end)
end
Link to this function

instrument(name, category, fun)

View Source

Specs

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

Instrument a function, and set the "appsignal:category" attribute to the value passed as the category argument.

Link to this function

instrument(_, name, category, fun)

View Source
This function is deprecated. Use Appsignal.instrument/3 instead..