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: delay loading error-callsites module #2906

Merged
merged 9 commits into from
Sep 12, 2022
Merged

Conversation

astorm
Copy link
Contributor

@astorm astorm commented Sep 4, 2022

Closes: #2833

Delays loading of error-callsites to agent start to avoid unwanted prepareStackTrace side effects prior to the agent starting.

Checklist

  • Implement code
  • Add tests
  • Update TypeScript typings
  • Update documentation
  • Add CHANGELOG.asciidoc entry

@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Sep 4, 2022
@astorm astorm requested a review from trentm September 4, 2022 21:15
@apmmachine
Copy link
Contributor

apmmachine commented Sep 4, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-07T21:31:17.656+0000

  • Duration: 18 min 19 sec

Test stats 🧪

Test Results
Failed 0
Passed 259126
Skipped 0
Total 259126

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@astorm
Copy link
Contributor Author

astorm commented Sep 4, 2022

@trentm still working up a test or two on this one but wanted to run the idea of wrapping error-callsites in a lazy load callback and then explicitly loading it in Agent.start. Was this what you had in mind or was there another approach you were considering?

lib/agent.js Outdated Show resolved Hide resolved
test/stacktraces/stacktraces.test.js Outdated Show resolved Hide resolved
@astorm astorm marked this pull request as ready for review September 7, 2022 20:49
@astorm astorm requested a review from trentm September 7, 2022 20:49
Copy link
Member

@trentm trentm left a comment

Choose a reason for hiding this comment

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

Looks good.

lib/agent.js Outdated Show resolved Hide resolved
CHANGELOG.asciidoc Outdated Show resolved Hide resolved
astorm and others added 2 commits September 7, 2022 14:30
Co-authored-by: Trent Mick <trent.mick@elastic.co>
Co-authored-by: Trent Mick <trent.mick@elastic.co>
@astorm astorm merged commit 94d416d into main Sep 12, 2022
@astorm astorm deleted the astorm/error-callsite-delay branch September 12, 2022 15:09
fpm-peter pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
* feat: Delay loading error-callsites module to avoid side effects.

elastic#2833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require("elastic-apm-node") influences stacktrace generated with "node --enable-source-maps ..."
3 participants