AsyncHooks API: O recurso que você precisa e não sabia!

Definition

The async_hooks module provides an API to register callbacks tracking the lifetime of asynchronous resources created inside
a Node.js application

The Problem

Node.js has a single thread on userland.

Incoming Request

Response

Concurrent Requests

Use Cases

Monitoring & timing

Diagnostics & tracing

Long stack traces

Continuation local storage

Stack traces

Stack trace: ProvisionedThroughputExceededException: The level of configured
provisioned throughput for the table was exceeded. Consider increasing your
provisioning level with the UpdateTable API.
at Request.extractError (node_modules/aws-sdk/lib/protocol/json.js:43:27)
at Request.callListeners (node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (node_modules/aws-sdk/lib/request.js:668:14)
at Request.transition (node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (node_modules/aws-sdk/lib/state_machine.js:14:12)
at node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.anonymous (node_modules/aws-sdk/lib/request.js:670:12)
at Request.callListeners (node_modules/aws-sdk/lib/sequential_executor.js:115:18)
at Request.emit (node_modules/aws-sdk/lib/request.js:668:14)
at Request.transition (node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (node_modules/aws-sdk/lib/state_machine.js:14:12)
at node_modules/aws-sdk/lib/state_machine.js:26:10