Logs
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes. The Elastic APM Node.js agent enables you to trace the execution of operations in your Node.js applications, sending performance metrics and errors to the Elastic APM Server. Availability This functionality is generally available and ready for production usage. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless Observability
Generally available
Stack
Generally available
APM Agent Node.js
Generally available
The Elastic APM Node.js Agent provides support for Log correlation. When used together with the ecs-logging-nodejs packages, correlation IDs will be automatically injected into log records to allow navigation between logs, traces, and services.
This feature is part of Application log ingestion strategies.
Log correlation allows you to navigate to all logs belonging to a particular trace and vice-versa: for a specific log, see in which context it has been logged and which parameters the user provided.
In order to correlate logs from your application with traces captured by the Elastic APM Node.js Agent, your logs must contain the following identifiers:
The APM Node.js Agent provides the apm.currentTraceIds API for this. If your application is also using one of the ECS formatting plugin packages (available for Pino, Winston, and Morgan), then this APM Agent API will automatically be used to inject the appropriate tracing fields into your log records. Otherwise, configure your logger to add these fields when emitting a log record.
When your logs contain the appropriate identifiers, the final step is to ingest them into the same Elasticsearch instance that contains your APM data. See Ingest your logs into Elasticsearch for more information.