Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const ScheduleEvents = require(path.join(__dirname, 'schedule_events'))
const S3Events = require(path.join(__dirname, 's3_events'))
const CloudWatchLogs = require(path.join(__dirname, 'cloudwatch_logs'))

const AWSXRay = require('aws-xray-sdk-core')
const createNamespace = require('continuation-local-storage').createNamespace

const maxBufferSize = 50 * 1024 * 1024

class Lambda {
Expand Down Expand Up @@ -116,7 +119,11 @@ event_sources.json and ${program.eventFile} files as needed.`)
console.log(JSON.stringify(results))
}

handler(event, context, callback)
const nameSpace = createNamespace('AWSXRay')
nameSpace.run(() => {
nameSpace.set('segment', new AWSXRay.Segment('annotations'))
handler(event, context, callback)
})

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with X-Ray too much, does this change mean that everyone needs to have it enabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is sufficient if only people using XRay are enabled.
Even if it is always enabled, there is no bad influence, so I always enabled it.

}

_runMultipleHandlers (events) {
Expand Down
Loading