feat(server-utils): Port S3, Kinesis, DynamoDB, SecretsManager and StepFunctions aws-sdk extensions#22164
Conversation
c3ac3ce to
0e20b44
Compare
size-limit report 📦
|
078c598 to
979ee5c
Compare
979ee5c to
e88a652
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
There are 11 total unresolved issues (including 7 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e88a652. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 8 total unresolved issues (including 7 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e88a652. Configure here.
07afc91 to
36d9255
Compare
52e07f6 to
69d0289
Compare
c61e735 to
7248300
Compare
69d0289 to
9510b15
Compare
7248300 to
50ce000
Compare
9510b15 to
61916ca
Compare
03eeceb to
fdd83ff
Compare
61916ca to
828e59f
Compare
fdd83ff to
735d2d1
Compare
88e502d to
cdb3108
Compare
735d2d1 to
36efbe1
Compare
95b65dd to
83ad645
Compare
48335ee to
1e0251f
Compare
83ad645 to
1f35fd2
Compare
48dafff to
f9f1f88
Compare
83ad645 to
24ff2be
Compare
72ca505 to
f9f1f88
Compare
83ad645 to
8889659
Compare
a1f3696 to
f9f1f88
Compare
8889659 to
83ad645
Compare
f9f1f88 to
f7642b4
Compare
742a195 to
75e28c4
Compare
f7642b4 to
8a0ff74
Compare
75e28c4 to
54789f2
Compare
8a0ff74 to
40bde8d
Compare
| if (normalizedRequest.commandInput?.ScanIndexForward) { | ||
| spanAttributes[ATTR_AWS_DYNAMODB_SCAN_FORWARD] = normalizedRequest.commandInput.ScanIndexForward; | ||
| } |
There was a problem hiding this comment.
Bug: The check for ScanIndexForward uses a truthy conditional, which incorrectly omits the span attribute when the value is explicitly false, a meaningful state for DynamoDB queries.
Severity: MEDIUM
Suggested Fix
Modify the conditional to explicitly handle both true and false values. Instead of a simple truthy check, verify the property is not undefined, for example: if (normalizedRequest.commandInput?.ScanIndexForward !== undefined). This will ensure the attribute is set correctly for both true and false values.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/dynamodb.ts#L108-L110
Potential issue: The code checks for the `ScanIndexForward` parameter using `if
(normalizedRequest.commandInput?.ScanIndexForward)`. This conditional only evaluates to
true for truthy values, causing it to fail when `ScanIndexForward` is explicitly set to
`false`. Since `false` is a valid and meaningful value indicating a reverse-order scan,
the `aws.dynamodb.scan_forward` span attribute is incorrectly omitted in this scenario.
This leads to a loss of observability for DynamoDB queries that request results in
descending order. A similar issue exists for the `ConsistentRead` parameter.
40bde8d to
508031c
Compare
54789f2 to
298d80e
Compare
…epFunctions aws-sdk extensions
…om @sentry/conventions
508031c to
d7d156a
Compare
| if (normalizedRequest.commandInput?.Segment) { | ||
| spanAttributes[ATTR_AWS_DYNAMODB_SEGMENT] = normalizedRequest.commandInput?.Segment; | ||
| } |
There was a problem hiding this comment.
Bug: The truthy check on commandInput.Segment fails when its value is 0, causing the span attribute for the first segment of a DynamoDB parallel scan to be dropped.
Severity: LOW
Suggested Fix
Modify the conditional check to correctly handle the case where Segment is 0. Instead of a truthy check, explicitly test if the value is not undefined or is a number, for example: if (normalizedRequest.commandInput?.Segment !== undefined).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
packages/server-utils/src/integrations/tracing-channel/aws-sdk/services/dynamodb.ts#L122-L124
Potential issue: In DynamoDB parallel scans, the `Segment` attribute is a zero-based
integer. The code checks for its existence with a simple truthy check: `if
(normalizedRequest.commandInput?.Segment)`. Because the number `0` is falsy in
JavaScript, this condition evaluates to false when `Segment` is `0`. As a result, the
`ATTR_AWS_DYNAMODB_SEGMENT` attribute is never added to the span for the first segment
of any parallel scan, leading to incomplete telemetry data for this operation.

Ports the attribute-only service extensions from the OTel aws-sdk integration to the orchestrion channel integration and registers them in the service registry:
aws.s3.bucketaws.kinesis.stream.namedb.*andaws.dynamodb.*request/response attributesaws.secretsmanager.secret.arn(request and response)Straight ports; none of these inject trace propagation or change span lifecycle.
Part of #20946