-
Notifications
You must be signed in to change notification settings - Fork 9
docs(configuration): pair threads.preload with preloadRequire for dd-trace #644
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
Merged
+25
−9
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
de178ec
docs(configuration): pair threads.preload with preloadRequire for dd-…
Ethan-Arrowood 012d38e
docs(configuration): make every dd-trace preload example viable
Ethan-Arrowood 222a920
docs(configuration): make threads.preload guidance agent-neutral
Ethan-Arrowood 7c12d96
docs(configuration): split the preload guidance into short bullets pl…
Ethan-Arrowood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still presents a directly copyable dd-trace configuration with only
preload, but the new text establishes thatdd-trace/register.jsdoes not callinit(). Adding an instrumentation module to this example therefore leaves each worker's tracer uninitialized and exports no traces—the silent failure this PR is fixing. AddpreloadRequire: dd-trace/initto this example too (or usedd-trace/initialize.mjsas the single preload) so every shown dd-trace configuration is viable.(
reference/configuration/options.md:81is not part of this PR's diff — anchored to the nearest line this PR's diff can hold)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch — fixed. The multi-module example now carries
preloadRequire: dd-trace/initalongside thepreloadlist, so every dd-trace configuration shown on the page is viable.I did chase down
initialize.mjs, and it is not the simpler single entry it looks like: on 6.x it gates both itsinit()call and itsModule.register('./loader-hook.mjs')behindisMainThread, and its exportedload/resolvehooks only take effect when the file is passed to--loader. Since we preload with--importin the worker'sexecArgv, that means it starts nothing and registers nothing on a worker thread — I confirmed it on dd-trace 6.12.0 / Node 24.19.0, where the worker's tracer stays aNoopTracer, i.e. the same silent failure asregister.jsalone, minus the loader hooks.So I've stuck with the two-key pairing and added a line to the
preloadbullet recording whyinitialize.mjsisn't a shortcut around it, so the next person doesn't reach for it either.sent with Claude Opus 5