telemetry_metrics_appsignal v1.1.0 TelemetryMetricsAppsignal View Source
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.Metrics | AppSignal |
---|---|
last_value | gauge |
counter | counter |
sum | counter , increased by the provided value |
summary | measurement |
distribution | Not supported |
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Link to this section Types
option()
View Sourceoption() :: {:metrics, [metric()]} | {:name, GenServer.name()}
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.