@@ -10,11 +10,8 @@ const aws4 = require('../lib/aws4');
10
10
const log = require ( '../lib/log' ) ;
11
11
const cloudwatch = require ( '../lib/cloudwatch' ) ;
12
12
const AWSXRay = require ( 'aws-xray-sdk' ) ;
13
-
14
- const middy = require ( 'middy' ) ;
13
+ const wrapper = require ( '../middleware/wrapper' ) ;
15
14
const { ssm, secretsManager } = require ( 'middy/middlewares' ) ;
16
- const sampleLogging = require ( '../middleware/sample-logging' ) ;
17
- const captureCorrelationIds = require ( '../middleware/capture-correlation-ids' ) ;
18
15
19
16
const STAGE = process . env . STAGE ;
20
17
const awsRegion = process . env . AWS_REGION ;
@@ -99,6 +96,8 @@ const handler = co.wrap(function* (event, context, callback) {
99
96
100
97
cloudwatch . incrCount ( 'RestaurantsReturned' , restaurants . length ) ;
101
98
99
+ yield http ( { uri : 'http://google.com' } ) ;
100
+
102
101
const response = {
103
102
statusCode : 200 ,
104
103
body : html ,
@@ -110,9 +109,7 @@ const handler = co.wrap(function* (event, context, callback) {
110
109
callback ( null , response ) ;
111
110
} ) ;
112
111
113
- module . exports . handler = middy ( handler )
114
- . use ( captureCorrelationIds ( { sampleDebugLogRate : 0.01 } ) )
115
- . use ( sampleLogging ( { sampleRate : 0.01 } ) )
112
+ module . exports . handler = wrapper ( handler )
116
113
. use ( ssm ( {
117
114
cache : true ,
118
115
cacheExpiryInMillis : 3 * 60 * 1000 , // 3 mins
0 commit comments