Reporting Check-ins via your AppSignal Integration
AppSignal offers helper methods/functions that send check-ins automatically with the following integrations:
This documentation will explain how you can use AppSignal's helpers to send check-ins from your app's processes.
Check-in types
Our helpers allow you to monitor background processes by sending AppSignal Start and Finish check-ins:
- Start Check-in notify AppSignal that a process has started, its status will be updated to
Running
. - Finish Check-in notify AppSignal that a process has been completed, its status will be updated to:
Success
: if the process is completed within the Check-in's maximum job duration.Late
: if the process completes after the pre-defined maximum job duration.
Monitoring options
You can use AppSignal's helpers to either:
- Send a single Finish Check-in to notify AppSignal when a process is completed.
- Send two separate check-ins: a Start Check-in to signal the start of a process and a Finish Check-in to signal its completion to AppSignal.
When sending both a Start and Finish Check-in AppSignal can report the actual run time of the process being monitored.
Send Finish Check-ins
To send a Finish Check-in, execute the cron
helper function at the end of the process you are monitoring.
The cron helper requires you to pass the name of the cron check-in you are monitoring, as it's defined in AppSignal.
For example, when sending a Finish Check-in from a process, with the Check-in name of send_invoices
:
def send_invoices do # ... your code here ... Appsignal.CheckIn.cron("send_invoices") end
// Don't forget to import the `checkIn` helpers: import { checkIn } from "@appsignal/nodejs"; function sendInvoices() { // ... your code here ... checkIn.cron("send_invoices"); }
# Don't forget to import the `cron` helper function from the # `appsignal.check_in` module. from appsignal.check_in import cron def send_invoices(): # ... your code here ... cron("send_invoices")
def send_invoices # ... your code here ... Appsignal::CheckIn.cron("send_invoices") end
Send Start and Finish Check-ins
Depending on your programming language, you can pass either a function or block to the cron
helper to report when the process starts and finishes, allowing you to see the duration of the process.
def send_invoices do Appsignal.CheckIn.cron("send_invoices", fn -> # ... your code here ... end) end
// Don't forget to import the `checkIn` helpers: import { checkIn } from "@appsignal/nodejs"; function sendInvoices() { checkIn.cron("send_invoices", () => { // ... your code here ... }); } // If the function passed to `cron` returns a promise, the finish event // will be reported to AppSignal if the promise resolves, allowing you // to track the duration of async functions: import { checkIn } from "@appsignal/nodejs"; async function sendInvoices() { await checkIn.cron("send_invoices", async () => { // ... your async code here ... }); } // If the promise is rejected, or if it never resolves, the finish event // will not be reported to AppSignal.
# Don't forget to import the `cron` helper function from the # `appsignal.check_in` module. from appsignal.check_in import cron def send_invoices(): # ... your code here ... cron("send_invoices", send_invoices)
def send_invoices() Appsignal::CheckIn.cron("send_invoices") do # ... your code here ... end end
Exceptions
If an exception is raised within the function or method being monitored, the finish event will not be reported to AppSignal, triggering a missing check-in notification.
If the process from where the exception is raised is an AppSignal supported integration then an exception will be reported to AppSignal independently from the check-in:
- Supported Elixir integrations
- Supported Node.js integrations
- Supported Python integrations
- Supported Ruby integrations
Reviewing check-ins occurrences in AppSignal
Once configured, AppSignal will begin to display information about occurrences for your check-ins.
You can read more about occurrences in our Check-in Occurrences documentation.