AppSignal v2.0.0-alpha.5 Appsignal View Source

AppSignal for Elixir. Follow the installation guide to install AppSignal into your Elixir app.

This module contains the main AppSignal OTP application, as well as a few helper functions for sending metrics to AppSignal.

These metrics do not rely on an active transaction being present. For transaction related-functions, see the Appsignal.Transaction module.

Link to this section Summary

Functions

Add a value to a distribution

Increment a counter of a metric.

Instrument a function.

Set a gauge for a measurement of a metric.

Link to this section Functions

Link to this function

add_distribution_value(key, value, tags \\ %{})

View Source

Specs

add_distribution_value(String.t(), float() | integer(), map()) :: :ok

Add a value to a distribution

Use this to collect multiple data points that will be merged into a graph.

Link to this function

increment_counter(key, count \\ 1, tags \\ %{})

View Source

Specs

increment_counter(String.t(), number(), map()) :: :ok

Increment a counter of a metric.

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

set_gauge(key, value, tags \\ %{})

View Source

Specs

set_gauge(String.t(), float() | integer(), map()) :: :ok

Set a gauge for a measurement of a metric.