Node.js SDK with ESM
How to add nodejs sdk into your application
1. Installing node-SDK package
npm install @hypertestco/node-sdk --save-exact 2. Initializing sdk
2.1 Adding SDK in code and Initialize open telemetry sdk with hypertest
// import * as htSdk from '@hypertestco/node-sdk'; // for esm/ts
const htSdk = require('@hypertestco/node-sdk'); // for commonJS
htSdk.initialize({
apiKey: '<your-api-key>',
serviceId: '<your-service-identifier-from-dashboard>',
serviceName: '<organizationName:service-name>',
exporterUrl: '<hypertest-logger-url>',
// ignoredHostsForHttpReqs: ['abc.xyz.com', /^\d+\.abcd\.co(m|)$/],
// disableInstrumentations: [] // htSdk.HtInstrumentations enum.
});2.2 Mark app as ready
2.3 Use hypertest esm hooks
2.3 Set env if opentelemetry is already being used.
3. Verifying traffic is captured

Last updated