Skip to main content
The AppSignal integrations for Ruby, Elixir, Node.js and Python offer helper methods and functions that allow you to easily send process monitor events to AppSignal.
The integration helpers still use CheckIn, checkIn, and check_in in code for compatibility with existing applications.

Cron process monitor events

To notify AppSignal that a cron job has finished successfully, use the cron helper function, passing the name of the cron process monitor as an argument.
def send_invoices
  # ... your code here ...
  Appsignal::CheckIn.cron("send_invoices")
end
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.
def send_invoices()
  Appsignal::CheckIn.cron("send_invoices") do
    # ... your code here ...
  end
end
If an exception is raised within the function or method being monitored, the finish event will not be reported to AppSignal, triggering a missing process monitor 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 process monitor events

To send a heartbeat process monitor event to AppSignal, use the heartbeat helper function, passing the name of the heartbeat process monitor 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.
loop do
  Appsignal::CheckIn.heartbeat("job_processor")
  # ... your code here ...
end

Sending heartbeats continuously

To send heartbeat process monitors 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.
Appsignal::CheckIn.heartbeat("job_processor", continuous: true)

Reviewing process monitor occurrences in AppSignal

Once configured, AppSignal will begin to display information about occurrences for your process monitors. You can read more about occurrences in our process monitor occurrences documentation.