Skip to content

Commit

Permalink
Merge branch 'main' into sqs-batch-receive
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk authored Nov 26, 2024
2 parents 680f7d2 + 2784357 commit 6b7cb26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 2 additions & 6 deletions examples/redis/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const tracer = setupTracing('example-redis-server');
import * as express from 'express';
import axios from 'axios';
import * as tracerHandlers from './express-tracer-handlers';
import { randomBytes } from 'crypto';
const redisPromise = require('./setup-redis').redis;

// Setup express
Expand All @@ -20,12 +21,7 @@ async function setupRoutes() {
const redis = await redisPromise;

app.get('/run_test', async (req: express.Request, res: express.Response) => {
const uuid = Math.random()
.toString(36)
.substring(2, 15)
+ Math.random()
.toString(36)
.substring(2, 15);
const uuid = randomBytes(16).toString('hex');
await axios.get(`http://localhost:${PORT}/set?args=uuid,${uuid}`);
const body = await axios.get(`http://localhost:${PORT}/get?args=uuid`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
}

const handler = path.basename(handlerDef);
const moduleRoot = handlerDef.substr(0, handlerDef.length - handler.length);
const moduleRoot = handlerDef.substring(
0,
handlerDef.length - handler.length
);

const [module, functionName] = handler.split('.', 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class SnsServiceExtension implements ServiceExtension {
if (topicArn || targetArn) {
const arn = topicArn ?? targetArn;
try {
return arn.substr(arn.lastIndexOf(':') + 1);
return arn.substring(arn.lastIndexOf(':') + 1);
} catch (err) {
return arn;
}
Expand Down

0 comments on commit 6b7cb26

Please sign in to comment.