View Source TelemetryMetricsAppsignal (telemetry_metrics_appsignal v1.5.0)

AppSignal Reporter for Telemetry.Metrics definitions.

This reporter is useful for getting custom metrics into AppSignal from your application. These custom metrics are especially useful for building custom dashboards.

To use the reporter, first define a list of metrics as shown here:

def metrics, do:
  [
    summary("phoenix.endpoint.stop.duration"),
    last_value("vm.memory.total"),
    counter("my_app.my_server.call.exception")
  ]

It's recommended to start TelemetryMetricsAppsignal under a supervision tree, either in your main application or as recommended here if using Phoenix:

{TelemetryMetricsAppsignal, [metrics: metrics()]}

Putting that altogether, your configuration could look something like this:

def start_link(_arg) do
  children = [
    {TelemetryMetricsAppsignal, [metrics: metrics()]},
    ...
  ]
  Supervisor.init(children, strategy: :one_for_one)
end

defp metrics, do:
  [
    summary("phoenix.endpoint.stop.duration"),
    last_value("vm.memory.total"),
    counter("my_app.my_server.call.exception")
  ]

Optionally you can register a name:

  {TelemetryMetricsAppsignal,
    [metrics: metrics(), name: MyTelemetryMetricsAppsignal]}

The following table shows how Telemetry.Metrics metrics map to AppSignal metrics:

Telemetry.MetricsAppSignal
last_valuegauge
countercounter
sumcounter, increased by the provided value
summarymeasurement
distributionNot supported

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_event(event_name, measurements, metadata, config)

View Source
@spec start_link([option()]) :: GenServer.on_start()