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(koa): fix instrumentation of ESM-imported koa #1736

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

chentsulin
Copy link
Contributor

Which problem is this PR solving?

  • ESM-imported koa is not patched by instrumentation.

Short description of the changes

@chentsulin chentsulin requested a review from a team October 13, 2023 05:31
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 13, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@pichlermarc
Copy link
Member

Hi, thanks for your contribution and sorry for the late review. #

#1735 introduced a simple way to test if everything is working as intended with ESM instrumentations. Would you mind adding this to this PR as well?

@chentsulin
Copy link
Contributor Author

Hi @pichlermarc, I failed to create a proper test case based on the #1735 PR. Is there anyone can help?

@trentm
Copy link
Contributor

trentm commented Dec 5, 2023

I can help add a test case.

@trentm trentm self-assigned this Dec 5, 2023
… spans are created; add asserts for the expected spans
Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Merging #1736 (04fda28) into main (8f2a195) will decrease coverage by 0.03%.
The diff coverage is 77.77%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1736      +/-   ##
==========================================
- Coverage   91.49%   91.47%   -0.03%     
==========================================
  Files         144      144              
  Lines        7388     7394       +6     
  Branches     1474     1478       +4     
==========================================
+ Hits         6760     6764       +4     
- Misses        628      630       +2     
Files Coverage Δ
...lemetry-instrumentation-koa/src/instrumentation.ts 95.40% <77.77%> (-2.13%) ⬇️

Copy link
Member

@JamieDanielson JamieDanielson left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@trentm
Copy link
Contributor

trentm commented Dec 6, 2023

Thanks for the reviews. I turned on the TAV tests here and I see that they fail, so I may need to dig into that. It might be a separate issue, though.

Update: It was a race in the newly added test. Fixed in commit 06fc6ba.

The ESM test case runs use-koa.mjs and expects some spans. It relies
on the ordering of those spans (based on start time). In some runs
two spans were starting in the same millisecond and the sort order
was ill-defined, which caused tests to fail.
@trentm trentm merged commit b61f912 into open-telemetry:main Dec 7, 2023
15 of 16 checks passed
@dyladan dyladan mentioned this pull request Dec 7, 2023
@trentm
Copy link
Contributor

trentm commented Dec 7, 2023

Thanks @chentsulin!

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