File tree Expand file tree Collapse file tree 5 files changed +11
-12
lines changed
opentelemetry-instrumentation-aws-lambda/src
opentelemetry-instrumentation-aws-sdk/src/services Expand file tree Collapse file tree 5 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const tracer = setupTracing('example-redis-server');
77import * as express from 'express' ;
88import axios from 'axios' ;
99import * as tracerHandlers from './express-tracer-handlers' ;
10+ import { randomBytes } from 'crypto' ;
1011const redisPromise = require ( './setup-redis' ) . redis ;
1112
1213// Setup express
@@ -20,12 +21,7 @@ async function setupRoutes() {
2021 const redis = await redisPromise ;
2122
2223 app . get ( '/run_test' , async ( req : express . Request , res : express . Response ) => {
23- const uuid = Math . random ( )
24- . toString ( 36 )
25- . substring ( 2 , 15 )
26- + Math . random ( )
27- . toString ( 36 )
28- . substring ( 2 , 15 ) ;
24+ const uuid = randomBytes ( 16 ) . toString ( 'hex' ) ;
2925 await axios . get ( `http://localhost:${ PORT } /set?args=uuid,${ uuid } ` ) ;
3026 const body = await axios . get ( `http://localhost:${ PORT } /get?args=uuid` ) ;
3127
Original file line number Diff line number Diff line change 77 "scripts" : {
88 "docker:start" : " cd ./docker && docker-compose down && docker-compose up" ,
99 "docker:startd" : " cd ./docker && docker-compose down && docker-compose up -d" ,
10- "start" : " webpack-dev-server -d -- progress --colors --port 8090 --config webpack.config.js --hot --inline -- host 0.0.0.0 --content-base examples "
10+ "start" : " webpack-dev-server -- progress --color --port 8090 --config ./ webpack.config.js --hot --host 0.0.0.0"
1111 },
1212 "repository" : {
1313 "type" : " git" ,
3131 "babel-loader" : " ^8.3.0" ,
3232 "ts-loader" : " ^6.2.2" ,
3333 "webpack" : " 5.89.0" ,
34- "webpack-cli" : " ^3.3.12 " ,
35- "webpack-dev-server" : " ^3.11.3 " ,
34+ "webpack-cli" : " ^5.0.0 " ,
35+ "webpack-dev-server" : " ^4.0.0 " ,
3636 "webpack-merge" : " ^4.2.2"
3737 },
3838 "dependencies" : {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ const common = {
4949module . exports = webpackMerge ( common , {
5050 devtool : 'eval-source-map' ,
5151 devServer : {
52- contentBase : path . resolve ( __dirname ) ,
52+ static : path . resolve ( path . join ( __dirname , "examples" ) ) ,
5353 } ,
5454 plugins : [
5555 new webpack . DefinePlugin ( {
Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
9090 }
9191
9292 const handler = path . basename ( handlerDef ) ;
93- const moduleRoot = handlerDef . substr ( 0 , handlerDef . length - handler . length ) ;
93+ const moduleRoot = handlerDef . substring (
94+ 0 ,
95+ handlerDef . length - handler . length
96+ ) ;
9497
9598 const [ module , functionName ] = handler . split ( '.' , 2 ) ;
9699
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export class SnsServiceExtension implements ServiceExtension {
9393 if ( topicArn || targetArn ) {
9494 const arn = topicArn ?? targetArn ;
9595 try {
96- return arn . substr ( arn . lastIndexOf ( ':' ) + 1 ) ;
96+ return arn . substring ( arn . lastIndexOf ( ':' ) + 1 ) ;
9797 } catch ( err ) {
9898 return arn ;
9999 }
You can’t perform that action at this time.
0 commit comments