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

fix(connect): fix wrong rpcMetada.route value not handle nested route #1555

Merged
merged 15 commits into from
Aug 12, 2023

Conversation

chigia001
Copy link
Contributor

@chigia001 chigia001 commented Jul 4, 2023

Which problem is this PR solving?

Short description of the changes

  • Need another layer of patching for connect's handle method. Whenever handle is call, we add another layer in the stack. If handle also call with an out method, we must pop the stack before out is execute. (this is opposite with current patched next where we call next first before finish span)
  • On route's middlewere, each time connect call the route's handle, update the latest value in the stack with middlewere's route value, use current stack value to calculate current rpcMetadata.route value.
  • This setup allow capture the last route middlewere executed with correct nested app.

@chigia001 chigia001 requested a review from a team July 4, 2023 06:42
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #1555 (db31f3e) into main (8802eae) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
+ Coverage   91.75%   91.80%   +0.04%     
==========================================
  Files         137      139       +2     
  Lines        7084     7124      +40     
  Branches     1426     1432       +6     
==========================================
+ Hits         6500     6540      +40     
  Misses        584      584              
Files Changed Coverage Δ
...try-instrumentation-connect/src/instrumentation.ts 99.01% <100.00%> (+0.25%) ⬆️
...etry-instrumentation-connect/src/internal-types.ts 100.00% <100.00%> (ø)
...opentelemetry-instrumentation-connect/src/utils.ts 100.00% <100.00%> (ø)

@pichlermarc
Copy link
Member

pichlermarc commented Jul 4, 2023

Broken CI will be fixed once #1556 is merged, sorry for the inconvenice. 😞

@chigia001
Copy link
Contributor Author

I think this PR also have some GH action's cache issue like my PR for express. Not sure how we can resolve those issue.

@chigia001 chigia001 changed the title fix(connect): fix wrong rpcMetada.route value not handle nested route fix(instrumentation-connect): fix wrong rpcMetada.route value not handle nested route Jul 13, 2023
@chigia001 chigia001 changed the title fix(instrumentation-connect): fix wrong rpcMetada.route value not handle nested route fix(connect): fix wrong rpcMetada.route value not handle nested route Jul 14, 2023
@chigia001
Copy link
Contributor Author

can we merge this or add pkg:instrumentation-connect label so we can test tav for this?

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

LGTM. Apologies for the long time to review, and thank you for all the great contributions.

I added a few nit comments which are all optional and do not block. Feel free to resolve them if you don't want to spend more time on this PR (or address them if you are in the mood).

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks for addressing the comments 🙏 and for these contributions.

Please fix the lint so I can merge

@chigia001
Copy link
Contributor Author

@blumamir fixed

@blumamir blumamir merged commit 704f76f into open-telemetry:main Aug 12, 2023
13 checks passed
@dyladan dyladan mentioned this pull request Aug 12, 2023
@chigia001 chigia001 deleted the fix-connect-nested-route branch August 12, 2023 07:43
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.

5 participants