feat(transformer): add objectName+propertyName selector to #fromFunctionQuery#58
Merged
bizob2828 merged 5 commits intonodejs:mainfrom Apr 6, 2026
Merged
Conversation
…transformer.js, generating an esquery selector that targets async functions assigned to a specific property on a specific object
bizob2828
approved these changes
Apr 6, 2026
Contributor
Author
|
Thank you for the review! Ready to merge when you are 🫡 |
jsumners-nr
reviewed
Apr 6, 2026
jsumners-nr
approved these changes
Apr 6, 2026
Merged
crysmags
added a commit
to DataDog/dd-trace-js
that referenced
this pull request
Apr 7, 2026
…trion-config Replaces custom rewriter instrumentations/mariadb.js with entries in orchestrion-config/index.js using the standard YAML format. thisPropertyName is expressed as object_name/property_name per nodejs/orchestrion-js#58. noCallbackFallback entries are marked with TODO comments pending nodejs/orchestrion-js support. Reverts rewriter changes to transformer.js, transforms.js, instrumentations/index.js, and associated tests.
crysmags
added a commit
to DataDog/dd-trace-js
that referenced
this pull request
Apr 7, 2026
…trion-config Replaces custom rewriter instrumentations/mariadb.js with entries in orchestrion-config/index.js using the standard YAML format. thisPropertyName is expressed as object_name/property_name per nodejs/orchestrion-js#58. noCallbackFallback entries are marked with TODO comments pending nodejs/orchestrion-js support. Reverts rewriter changes to transformer.js, transforms.js, instrumentations/index.js, and associated tests.
Contributor
|
Why add |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Adds
objectNameandpropertyNamefields to#fromFunctionQueryinlib/transformer.js, generating an esquery selector that targets async functions assigned to a specific property on a specific object:thisis handled as a special case because it is aThisExpressionnode in the AST, not anIdentifier— so it cannot be matched withleft.object.name.Why existing query types don't cover this
The target pattern is an arrow function assigned to an object property inside a function constructor:
methodNametargetsClassBody > MethodDefinitionandProperty(object literal) nodes — a different AST shape entirely. Assignment expressions in constructors are not matched.expressionNamedoes generateAssignmentExpression[left.property.name="..."]selectors, but without any constraint on the receiver. In files where the same property name is assigned on multiple different objects, this produces false positives and instruments the wrong functions.objectName + propertyNamepins both the receiver and the property, giving a precise match equivalent to whatclassName + methodNamegives for class methods.Usage