We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ca8844 commit 2e652b3Copy full SHA for 2e652b3
_lambda/random-name/index.js
@@ -7,12 +7,13 @@ var Chance = require('chance');
7
var myFunction = function(event, context, callback) {
8
var sns = new AWS.SNS();
9
var chance = new Chance();
10
- var segment = AWSXRay.getSegment();
11
var userid = event.userid;
12
- segment.addAnnotation('User ID', userid);
13
-
14
var name = chance.first();
15
- segment.addAnnotation('Name', name);
+
+ AWSXRay.captureFunc('annotations', function(subsegment){
+ subsegment.addAnnotation('Name', name);
+ subsegment.addAnnotation('UserID', event.userid);
16
+ });
17
18
// Notify
19
var params = {
0 commit comments