Appsignal.Instrumentation (AppSignal v2.1.7) View Source

Link to this section Summary

Functions

Instrument a function.

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

Send an error in a newly created Appsignal.Span.

Send an error in a newly created Appsignal.Span. Calls the passed function with the created Appsignal.Span before closing it.

Set an error in the current root span.

Set an error in the current root span by passing a kind and reason.

Link to this section Functions

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..
Link to this function

send_error(exception, stacktrace)

View Source

Specs

send_error(Exception.t(), Exception.stacktrace()) :: Appsignal.Span.t() | nil

Send an error in a newly created Appsignal.Span.

Link to this function

send_error(exception, stacktrace, fun)

View Source

Specs

Send an error in a newly created Appsignal.Span. Calls the passed function with the created Appsignal.Span before closing it.

Link to this function

send_error(kind, reason, stacktrace, fun)

View Source
Link to this function

set_error(exception, stacktrace)

View Source

Specs

Set an error in the current root span.

Link to this function

set_error(kind, reason, stacktrace)

View Source

Specs

Set an error in the current root span by passing a kind and reason.