Changelog

Improving AppSignal, one deploy at a time.

Sep 26, 2024

Heartbeat check-ins and other improvements

Node.js3.5.0

Added

  • Add support for heartbeat check-ins.

    Use the checkIn.heartbeat method to send a single heartbeat check-in event from your application. This can be used, for example, in your application's main loop:

    javascript
    import { checkIn } from "@appsignal/nodejs"; while (true) { checkIn.heartbeat("job_processor"); await processJob(); }
    javascript
    import { checkIn } from "@appsignal/nodejs"; while (true) { checkIn.heartbeat("job_processor"); await processJob(); }

    Heartbeats are deduplicated and sent asynchronously, without blocking the current thread. Regardless of how often the .heartbeat method is called, at most one heartbeat with the same identifier will be sent every ten seconds.

    Pass {continuous: true} as the second argument to send heartbeats continuously during the entire lifetime of the current process. This can be used, for example, after your application has finished its boot process:

    javascript
    import { checkIn } from "@appsignal/nodejs"; function main() { checkIn.heartbeat("job_processor", { continuous: true }); startApp(); }
    javascript
    import { checkIn } from "@appsignal/nodejs"; function main() { checkIn.heartbeat("job_processor", { continuous: true }); startApp(); }

Changed

  • Send check-ins concurrently. When calling Appsignal.checkIn.cron, instead of blocking the current process while the check-in events are sent, schedule them to be sent in a separate process.
  • Do not block Node.js shutdown. It is no longer necessary to call Appsignal.stop for the Node.js engine to allow itself to shut down. It should still be called and awaited in production scenarios and at the end of scripts, as it ensures that scheduled check-ins are delivered.

View the Node.js package v3.5.0 changelog for more information.

View all Node.js updates

Start your free trial

Don’t let the bad bugs bite. Try AppSignal for free.

AppSignal offers a 30-day free trial, no credit card is required. All features are available in all plans. Start monitoring your application in just a few clicks!