Sending check-in events using the AppSignal integrations
The AppSignal integrations for Ruby, Elixir, Node.js and Python offer helper methods and functions that allow you to easily send check-in events to AppSignal.
Cron check-in events
To notify AppSignal that a cron job has finished successfully, use the cron
helper function, passing the name of the cron check-in as an argument.
It is safe to call the cron
helper function many times in a short period, as the helper will only send a finish event to AppSignal at most once every ten seconds.
Monitoring the job's duration
To monitor the duration of a cron job, you can use the cron
helper function with a block or function that contains the code you want to monitor. This will send events to AppSignal both when the job starts and when it finishes.
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. The exception will be re-raised.
If the context in which the exception is raised is an AppSignal-monitored context, then the exception will be reported to AppSignal. Otherwise, if you wish to report the exception to AppSignal, you can use our exception handling helpers for Ruby, Elixir, Node.js or Python.
Heartbeat check-in events
To send a heartbeat check-in event to AppSignal, use the heartbeat
helper function, passing the name of the heartbeat check-in as an argument.
It is safe to call heartbeat
many times, as the helper will only send a heartbeat event to AppSignal at most every ten seconds.
Sending heartbeats continuously
To send heartbeat check-ins continuously, you can pass the { continuous: true }
option to the heartbeat
helper function. This is useful to monitor the lifetime of the process itself. The helper will send a heartbeat event to AppSignal every thirty seconds.
Reviewing check-in 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.