Node.js
SUSE Observability
Last updated
SUSE Observability
Last updated
Automatic instrumentation for Node.js is done by including the automatic instrumentation Javascript libraries with your application. A wide range of .
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 , 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 .
The auto instrumentation configured via environment variables only supports traces until this is resolved. To enable metrics from the automatic instrumentation code changes are needed. Please follow the instructions in the to make these changes.
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 .
Make sure you use the OTLP exporter and configure the exporter endpoint correctly from the code. See also the . Assuming you set up the exporter as the endpoint that needs to be configured is http://opentelemetry-collector.open-telemetry.svc.cluster.local:4317
, using gRPC. See also in case gRPC is problematic.