eslint-plugin-stedi-aws-rules icon indicating copy to clipboard operation
eslint-plugin-stedi-aws-rules copied to clipboard

instrument-document-clients does not work for non-assignment instrumentation

Open mpuhacz opened this issue 4 years ago • 0 comments

instrument-document-clients does not work for non-assignment instrumentation

  const db = new DynamoDB.DocumentClient();
  AWSXRay.captureAWSClient((db as any).service);

  const { Items } = await db
    .query({
      TableName: await tableName,
      KeyConditionExpression: "pk = :email AND sk <= :now",
      ExpressionAttributeValues: {
        ":email": testEmail.testEmailPk(event.queryStringParameters.email),
        ":now": new Date().toISOString(),
      },
    })
    .promise();
[check:lint]   17:27  error  Called db before it was instrumented  @stedi-oss/stedi-aws-rules/instrument-document-clients
[check:lint]
[check:lint] ✖ 1 problem (1 error, 0 warnings)

mpuhacz avatar Dec 22 '20 12:12 mpuhacz