Cloud de Confiance by S3NS provides powerful monitoring, logging, and diagnostics for Node.js applications.
The Node.js client libraries are instrumented to emit tracing data. The instrumentation is opt-in; you need to explicitly enable it. This document describes the available signals and how to enable them.
Available signals
The Node.js client libraries are instrumented to generate the following signals:
INFOspans for each logical client request. Typically a single method call in the client struct gets such a span (for example, callingaccessSecretVersionon aSecretManagerServiceClient).INFOspans for each low-level RPC attempt. Typically a single method in the client struct gets one such span, but there may be more if the library has to retry the RPC.
These spans and logs follow OpenTelemetry Semantic
Conventions with additional
Cloud de Confiance by S3NS attributes. Both the spans and logs should be suitable for
production monitoring. The signals include standard OpenTelemetry attributes
(for example, http.response.status_code and rpc.system.name).
For a full list of standard attributes, see the OpenTelemetry HTTP and gRPC semantic conventions.
Enable telemetry signals
To protect sensitive data, telemetry signals are disabled by default.
In Node.js, you must configure the client to emit traces and must configure subscribers and exporters to send these signals to an external service.
To configure the client, you can set the following environment variable:
export GOOGLE_SDK_NODE_ENABLE_TRACING=true
When tracing is enabled and your application has an active OpenTelemetry span in the current context when you call a client library method, the client library automatically links its spans as children of your active span.
Exporting traces
Once telemetry is enabled in the client libraries, your application must be configured to collect and export this data to your observability service.
For detailed instructions on configuring the OpenTelemetry trace correlation data, see the observability sample within the Node.js repository.
To export the tracing spans generated by the Cloud de Confiance by S3NS client libraries
to OpenTelemetry, you need to set up a tracer provider and exporter:
const cloudTraceExporter = new TraceExporter();
const spanProcessor = new BatchSpanProcessor(cloudTraceExporter);
const provider = new NodeTracerProvider({
spanProcessors: [spanProcessor],
});
provider.register();