NodeJS
The Aspecto SDK is an OpenTelemetry-based product.
Install our Node.js library using
npm
:$ npm install @aspecto/opentelemetry
- 1.
-r @aspecto/opentelemetry/auto-instrument
e.g. your
node
invocation should look like this:// before
node ./app
// after
node -r @aspecto/opentelemetry/auto-instrument ./app
For example:
ASPECTO_AUTH="*your-token-goes-here*" node -r @aspecto/opentelemetry/auto-instrument ./app
After obtaining your token here, before any other import, add the following call at the top of your app entry point:
JavaScript
TypeScript
require('@aspecto/opentelemetry')({
aspectoAuth: '*your-token-goes-here*'
});
// ... other imports ...
import init from '@aspecto/opentelemetry';
init({
aspectoAuth: '*your-token-goes-here*'
});
// ... other imports ...
So far, you have configured your application to send telemetry to Aspecto for any inbound or outbound requests. Next, you will need to make requests to your service in order to generate the telemetry that will be sent to Aspecto.
Interact with your application by making a few requests. Telemetry data should now appear in the Aspecto UI!
Last modified 1yr ago