API 定義の出口によるトランザクション相関

Node.js サーバレストレーサの exit コールを手動で作成する場合は、相関ヘッダーを見つける必要があります。これは、関数が HTTP または AWS Lambda 間の exit コールを使用しない場合に必要です。

次のコードスニペットは、相関ヘッダーを作成する方法を示しています。

module.exports.myLambdaHandler = function () {
// Start Exit Call
var exitCall = tracer.startExitCall({
// Fill in with the exit call information
});
//Get your correlation header
if (exitCall) {
var correlationHeader = tracer.createCorrelationInfo(exitCall);
}
/*
* Your exit call code.
* Pass the correlation header in the exit call for downstream correlation.
*/
// Stop the exit call
if (exitCall) {
tracer.stopExitCall(exitCall);
}
}