Connect Node.js trace data with logs for Splunk Observability Cloud 🔗
You can configure Node logging libraries to include tracing attributes provided automatically by the Splunk Distribution of OpenTelemetry JS. Use the trace metadata to correlate traces with log events and explore Node application logs in Observability Cloud.
Supported logging libraries 🔗
The Splunk Distribution of OpenTelemetry JS automatically supports the following logging libraries:
Enable logs injection 🔗
Log injection is already enabled for the supported libraries. To inject trace data into formatted logs, see the documentation for each library.
Include trace metadata in log statements 🔗
The Splunk Distribution of OpenTelemetry JS provides the following attributes for logging libraries:
The format of each log message depends on the library. The following is a sample log message formatted using Pino:
Explore application logs in Log Observer 🔗
You can send Node.js application logs to Observability Cloud in the same way you send any other type of log data. To learn more about logs in Observability Cloud, see Set up Log Observer.