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

aj/fix lazy imports #393

Merged
merged 3 commits into from
May 15, 2023
Merged

aj/fix lazy imports #393

merged 3 commits into from
May 15, 2023

Conversation

astuyve
Copy link
Contributor

@astuyve astuyve commented May 15, 2023

  • fix: fix lazily loaded imports
  • feat: Fix lazy loaded imports

What does this PR do?

Needs tests.

This fixes an issue where lazy imports weren't traced.
This now parents them to the lambda span, like so:
image

Normal cold start traces are unaffected:
image

Motivation

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@astuyve astuyve requested a review from a team as a code owner May 15, 2023 17:57
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2023

Codecov Report

Merging #393 (b807f3e) into main (16a0a03) will decrease coverage by 0.14%.
The diff coverage is 57.14%.

❗ Current head b807f3e differs from pull request most recent head cf58500. Consider uploading reports for the commit cf58500 to get more accurate results

@@            Coverage Diff             @@
##             main     #393      +/-   ##
==========================================
- Coverage   80.88%   80.74%   -0.14%     
==========================================
  Files          38       38              
  Lines        1930     1937       +7     
  Branches      448      449       +1     
==========================================
+ Hits         1561     1564       +3     
- Misses        313      316       +3     
- Partials       56       57       +1     
Impacted Files Coverage Δ
src/trace/listener.ts 64.46% <25.00%> (-0.54%) ⬇️
src/runtime/require-tracer.ts 94.28% <66.66%> (-2.69%) ⬇️
src/trace/cold-start-tracer.ts 82.97% <66.66%> (-3.07%) ⬇️
src/runtime/index.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@duncanista duncanista left a comment

Choose a reason for hiding this comment

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

LGTM!

Just one question, now this cold start tracer turns into a double purpose because traces requires during execution? Or am I missing it?

@astuyve
Copy link
Contributor Author

astuyve commented May 15, 2023

@duncanista good question - it was always meant to trace module load times, we branded it cold start tracing as that's when it's usually most helpful

@astuyve astuyve merged commit 0548d77 into main May 15, 2023
@astuyve astuyve deleted the aj/fix-lazy-imports branch May 15, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants