Webhooks
AppSignal can send notifications of new incidents to several services, see our full list on the integrations. We also offer webhooks for these notifications so you handle new incidents in your own system.
To receive a webhook, go to the "Notifications" tab the site's sidebar, click the "Add integration" and fill out the URL where you'd like to receive your webhook data.
There are multiple webhooks available. Which payloads the webhook receives can be configured in the configuration form for the webhook as seen in the screenshot above.
Verifying AppSignal webhook requests
To ensure the security of your application, you can verify that incoming webhook requests are genuinely from AppSignal. Verification is done by using a Webhook verification token to validate the request's signature.
Locating your Webhook Verification Token
- Navigate to App settings > Integrations in your AppSignal dashboard.
- Configure the webhook integration you want to verify.
- Here you'll find the integration's Webhook verification token.
This token is used to validate that the webhook request is from AppSignal.
Verifying a request
When AppSignal sends a webhook request, it includes a signature in the X-Appsignal-Signature
header. You can validate the request as follows:
- Concatenate the AppSignal Webhook verification token with the raw request body.
- Generate a SHA256 hash of the concatenated string.
- Compare the generated hash to the value in the
X-Appsignal-Signature
header.
If the hashes match, the request can be verified as coming from AppSignal.
Example implementations
Below are some examples of how you can verify a request is coming from AppSignal in Ruby, Elixir, Node.js and Python.
Note: The examples below are illustrative, you may need to adapt them depending on the frameworks, integrations and dependencies your app uses.
Deploy markers
Fields
Field | Type | Description |
---|---|---|
marker | Hash<String, Any> | The webhook payload concerns a marker incident. |
Deploy marker sub-fields
Field | Type | Description |
---|---|---|
time | String | Timestamp at which the deploy marker was created. |
marker_id | String | Internal AppSignal marker id for the deploy marker. |
site | String | App name as seen on AppSignal.com. Using the site field instead of app for legacy reasons. |
environment | String | App environment of the app as seen on AppSignal.com. |
revision | String | The deploy marker revision name. |
user | String | The user that created the marker. |
repository | String | Url to the repository as configured for the app on AppSignal.com. |
url | String | Url to the app on AppSignal.com that triggered the webhook. |
Exception incidents
Fields
Field | Type | Description |
---|---|---|
exception | Hash<String, Any> | The webhook payload concerns a exception incident. |
Exception sub-fields
Field | Type | Description |
---|---|---|
time | String | Timestamp at which the exception occurred. |
number | Integer | Incident id as shown on AppSignal.com. |
site | String | App name as seen on AppSignal.com. Using the site field instead of app for legacy reasons. |
environment | String | App environment of the app as seen on AppSignal.com. |
app_url | String | Url to the app on AppSignal.com that triggered the webhook. |
url | String | Url to the specific sample for the incident on AppSignal.com that triggered this webhook. |
revision | String | The deploy marker revision name. |
user | String | The user that created the marker. The user value can also be null if not set for a deploy marker revision. |
namespace | String | The namespace in which this exception occurred. |
exception | String | The exception type that was recorded by AppSignal. |
message | String | The exception message with more details about the exception. |
app_backtrace | Array<String> | The lines of the backtrace concerning the app from which they originated. This excludes any backtrace lines from libraries that are included in the app. |
first_backtrace_line | String | The first backtrace line from the app_backtrace field. |
action | String | The action in which this exception occurred. Either a controller action, background worker or a manually set action. |
path | String | The request path on which the exception occurred. This is only set for web requests. This is metadata set by the AppSignal integration by default and is also included in the metadata field. |
hostname | String | The hostname of the host that this exception occurred on. |
action_label | String | A human friendly label for the type of action this exception occurred on. Uses request for the web namespace and job for the background namespace. All other namespaces use action . |
metadata | Hash<String, String> | This includes user set metadata (see Tagging feature]. |
Metadata fields
You can add your own metadata by tagging samples.
Field | Type | Description |
---|---|---|
demo_sample | String | Set by the AppSignal integration for demo samples send using our demo command line tool (Ruby / Elixir). Not set for all other samples. |
method | String | The request method used to perform a request. Only available for (web) requests. |
path | String | The request path on which the exception occurred. This is only set for web requests. Contains the same value as the path field. |
Performance incidents
Fields
Field | Type | Description |
---|---|---|
performance | Hash<String, Any> | The webhook payload concerns a performance incident. |
Performance sub-fields
Field | Type | Description |
---|---|---|
time | String | Timestamp at which the performance incident occurred. |
number | Integer | Incident id as shown on AppSignal.com. |
site | String | App name as seen on AppSignal.com. Using the site field instead of app for legacy reasons. |
environment | String | App environment of the app as seen on AppSignal.com. |
app_url | String | Url to the app on AppSignal.com that triggered the webhook. |
url | String | Url to the specific sample for the incident on AppSignal.com that triggered this webhook. |
revision | String | The deploy marker revision name. |
user | String | The user that created the marker. The user value can also be null if not set for a deploy marker revision. |
namespace | String | The namespace in which this performance incident occurred. |
duration | Float | The time in milliseconds measured which the request/job/action took to complete. |
action | String | The action in which this performance incident occurred. Either a controller action, background worker or a manually set action. |
path | String | The request path on which the performance incident occurred. This is only set for web requests. This is metadata set by the AppSignal integration by default and is also included in the metadata field. |
hostname | String | The hostname of the host that this performance incident occurred on. |
action_label | String | A human friendly label for the type of action this performance incident occurred on. Uses request for the web namespace and job for the background namespace. All other namespaces use action . |
metadata | Hash<String, String> | This includes user set metadata see metadata. |
Metadata fields
You can add your own metadata by tagging samples.
Field | Type | Description |
---|---|---|
demo_sample | String | Set by the AppSignal integration for demo samples send using our demo command line tool (Ruby / Elixir). Not set for all other samples. |
method | String | The request method used to perform a request. Only available for (web) requests. |
path | String | The request path on which the performance incident occurred. This is only set for web requests. Contains the same value as the path field. |
Anomaly detection
Field | Type | Description |
---|---|---|
alert_id | String | Internal AppSignal alert id for the alert. |
state | String | State of the alert. |
site | String | The application name alert belongs to. |
environment | String | The application environment name alert belongs to. |
tags | Array | Namespace associated with the alert. |
human_tags | Array | Custom namespace associated with the alert. |
metric_name | String | Name of the metric alert was created for. |
field | String | Field name of the alert. |
trigger_label | String | Name of the trigger. |
trigger_description | String | Description of the trigger. |
last_value | String | Last value recorded for the alert. |
peak_value | String | Highest value recorded for the alert |
mean_value | String | Mean of all values for the alert. |
comparison_operator | String | Comparison operator set by the user based on which the alert will be triggered. |
comparison_value | String | Comparison value of the metric set by the user based on which the alert will be triggered. |
human_last_value | String | Last metric value that recorded for the alert since it was opened in a more readable format. |
human_peak_value | String | Highest value of the metric value that was recorded for the alert while it was open. |
human_mean_value | String | Mean value of the metric value for the alert while it was open in a more readable format. |
human_comparison_value | String | Comparison value for the alert metric set by the user based on which the alert will be triggered in a readable format. |
created_at | String | Timestamp at which the alert was created. |
opened_at | String | Timestamp (ISO8601) at which the alert was opened. |
resolved_at | String | Timestamp (ISO8601) at which the alert was resolved. |
closed_at | String | Timestamp (ISO8601) at which the alert was closed. |
warmup_duration | String | Time in minutes AppSignal waits before opening a alert. |
cooldown_duration | String | Time in minutes AppSignal waits before closing a alert. |
alert_url | String | URl of the alert so user can view it on AppSignal. |
edit_trigger_url | String | URl of the alert so user can edit it on AppSignal. |