Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-sdk): SQS receive: use span links instead of processing spans #2345

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

seemk
Copy link
Contributor

@seemk seemk commented Jul 18, 2024

Which problem is this PR solving?

Drop SQS processing spans in favor of span links as per latest specification.

Fixes #707

Short description of the changes

Create a span link for each incoming message that has a propagation context.

@seemk seemk changed the title feat(aws-sdk): use span links instead of processing spans feat(aws-sdk): SQS receive: use span links instead of processing spans Jul 18, 2024
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.75%. Comparing base (97ebd4f) to head (454fbf2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2345      +/-   ##
==========================================
- Coverage   90.75%   90.75%   -0.01%     
==========================================
  Files         169      169              
  Lines        8018     8014       -4     
  Branches     1632     1630       -2     
==========================================
- Hits         7277     7273       -4     
  Misses        741      741              
Files with missing lines Coverage Δ
...emetry-instrumentation-aws-sdk/src/services/sqs.ts 100.00% <100.00%> (ø)

@github-actions github-actions bot requested a review from blumamir September 10, 2024 10:38
@seemk seemk requested a review from a team as a code owner September 25, 2024 04:14
@seemk
Copy link
Contributor Author

seemk commented Nov 6, 2024

@jj22ee

Copy link
Contributor

@jj22ee jj22ee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for addressing the previous issue(s) in this PR. Noting here that this is should be labelled as a Breaking Change (I see this is generally okay for minor version upgrades for a v0.x.y package).

Reading through the context to understand and cherry-picking some points here:

  • (summarized here) Current implementation of SQS Receive's process spans has issues related to async and has limitations in JavaScript
  • (discussed here) Latest OTel spec has removed mention of process spans for Batch Receiving, enabling this PR to drop the process spans

Since this PR follows updates in the latest spec and avoids issues summarized here, I don’t mind this change. I also want to know if @blumamir has additional thoughts in regards to these change to drop process spans?

),
const messages: SQS.Message[] = response?.data?.Messages || [];

span.setAttribute('messaging.batch.message_count', messages.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen some discussion that argues to stay with hardcoded attributes until they are stable, so maybe we can keep this as-is.

@@ -604,4 +304,76 @@ describe('SQS', () => {
);
});
});

describe('batch receive', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these tests. Currently these tests are for AWS SDK for JavaScript v2 which has entered maintenance mode and soon will not be supported. Do you mind if you can also write these tests for AWS SDK for JS v3?

Also you also could add assertions for messaging.batch.message_count to sqs tests in test/aws-sdk-v3.test.ts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion(instrumentation-aws-sdk): SQS receive according to semantic conventions
3 participants