{% hint style="info" %} The Aspecto SDK is an OpenTelemetry-based product. {% endhint %}
Install our Node.js library using npm
:
$ npm install @aspecto/opentelemetry
- Use node
-r
(or--require
) cli option to preload Aspecto SDK before application start:
-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
2. Set aspectoAuth
and other optional SDK options via environment variables or aspecto.json
file.
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:
{% tabs %} {% tab title="JavaScript" %}
require('@aspecto/opentelemetry')({
aspectoAuth: '*your-token-goes-here*'
});
// ... other imports ...
{% endtab %}
{% tab title="TypeScript" %}
import init from '@aspecto/opentelemetry';
init({
aspectoAuth: '*your-token-goes-here*'
});
// ... other imports ...
{% endtab %} {% endtabs %}
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!
Continue to the next step to start investigate your tracing data.
{% hint style="info" %} See the advanced page for specific configurations {% endhint %}