FAQAPMHow do I measure web sockets calls or background jobs?

Atatus APM automatically instruments all web requests. In case you want to instrument web sockets calls, background jobs, and unsupported databases, you need to use custom instrumentation as follows

var atatus = require("atatus-node");
var txn = atatus.startTransaction("custom transaction name", function() {
    atatus.createLayer("custom layer name", function () {
        // Your code here.
var atatus = require("atatus-node");
socket.on("message", atatus.startTransaction("new:chat-message", function (data) {
    addMessageToFirebase(data, function () {
      socket.emit("got the message");

Transaction timing consists of layers. Every transaction must have at-least one layer. Any database calls will be added automatically as layer to the transaction.

If you want to instrument an asynchronous function, you need to wrap the asynchronous function with createLayer().

queue.add(atatus.createLayer("add:notifications:channels", function (err, result) {
  if (err) {
  res.json({ success: true, data: result });