FESR Receiver for Node.js

Setup

In package.json:

{
    "dependencies": {
        "@sap/fesr-to-otel-js": "https://73555000100200018064.npmsrv.cdn.repositories.cloud.sap/@sap/fesr-to-otel-js/-/fesr-to-otel-js-1.5.11.tgz"
    }
}


Express

If your application uses express you can simply register the endpoint to your existing application:

const express = require('express');
const fesr = require("@sap/fesr-to-otel-js");
const app = express();

fesr.registerFesrEndpoint(app);


CAP

For CAP node.js applications create a file server.js. In this file you can hook onto the bootstrap event of CAP to register the endpoint:

const cds = require("@sap/cds");
const fesr = require("@sap/fesr-to-otel-js");

cds.on("bootstrap", (app) => fesr.registerFesrEndpoint(app));

module.exports = cds.server;


Logging

Log level can be specified via the the SAP_CALM_FESR_LOG_LEVEL environment variable, e.g.

SAP_CALM_FESR_LOG_LEVEL=debug