Node.js
SUSE Observability
Automatic instrumentation
Automatic instrumentation for Node.js is done by including the automatic instrumentation Javascript libraries with your application. A wide range of libraries and frameworks is supported.
Automatic instrumentation does not require any modifications of the application. To set it up follow these steps:
Add the Open Telemetry instrumentation SDK to your application:
Update the command that starts your application to load the SDK, either by updating the docker image entry point or command or by updating the
command
in the Kubernetes manifest for your application. Add--require @opentelemetry/auto-instrumentations-node/register
:
Deploy your application with the extra environment variables to configure the service name and exporter endpoint, supported protocols are gRPC and protobuf over HTTP.
Verify SUSE Observability is receiving traces and/or metrics by searching for the metrics / traces in the metrics / trace explorer for your service name
For more details please refer to the Open Telemetry documentation.
The auto instrumentation configured via environment variables only supports traces until this Open Telemetry issue is resolved. To enable metrics from the automatic instrumentation code changes are needed. Please follow the instructions in the Open Telemetry documentation to make these changes.
Manual instrumentation
Manual instrumentation can be used when you need metrics, traces or logs from parts of the code that are not supported by the auto instrumentation. For example unsupported libraries, in-house code or business-level metrics.
To capture that data you need to modify your application.
Include the Open Telemetry SDK as a dependency
Add code to your application to capture metrics, spans or logs where needed
There is detailed documentation for this on the Open Telemetry Javascript SDK doc pages.
Last updated