feat(instrumentation-typeorm): add support for typeorm@1.x - #3619
Open
katoztmy wants to merge 1 commit into
Open
feat(instrumentation-typeorm): add support for typeorm@1.x#3619katoztmy wants to merge 1 commit into
katoztmy wants to merge 1 commit into
Conversation
|
|
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-js-contrib. Important reminders:
|
typeorm@1.0.0 removed EntityManager#findByIds, which crashed the patch phase when the instrumentation attempted to wrap it. Skip wrapping methods that do not exist in the loaded version, and extend the supported version range to '>=0.3.0 <2'. typeorm@1.x also dropped the 'sqlite' (sqlite3) driver in favor of 'better-sqlite3' and requires Node.js 20.19+, so the tests pick the sqlite driver supported by the installed typeorm version, and the TAV config runs 1.x in a separate job with node '>=20' and better-sqlite3 as a peer dependency. Closes open-telemetry#3545 Assisted-By: Claude Fable 5
katoztmy
force-pushed
the
feat/typeorm-1x-support
branch
from
July 11, 2026 07:00
9115c48 to
e2435ba
Compare
Pull request dashboard statusWaiting on reviewers · refreshed 2026-08-10 13:49 UTC Review the latest changes. Status above doesn't look right?
|
Author
|
Hi @mhennoch @seemk @t2t2 @weyert — just a gentle ping on this PR, it's been about two weeks since it was opened and CI is green (tested against typeorm 0.3.x and 1.0.0). This is my first contribution here, so happy to adjust anything that doesn't fit the repo's conventions. Thanks for taking a look when you get a chance! |
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.
Which problem is this PR solving?
Fixes #3545
typeorm@1.0.0 removed
EntityManager#findByIds, and the instrumentation tries to wrap it unconditionally, so patching crashes with "Attempt to wrap undefined property findByIds as function". AlsosupportedVersionsis>=0.3.0 <1, so 1.x is not instrumented at all.Short description of the changes
>=0.3.0 <2. I kept the upper bound to avoid claiming support for major versions that are not verified yet, which is also why the existing code was capped at<1.findByIdsis affected.connectiongetter as-is. In 1.x it is deprecated but still works (it just returnsdataSource), and 0.3.x doesn't havedataSourceon EntityManager, soconnectionis the only property that works on both.sqlitedriver in favor ofbetter-sqlite3, so the test helper now picks whichever driver the installed typeorm supports. The tests themselves are unchanged..tav.ymlruns 1.x in a separate job withnode: ">=20"(typeorm 1.0 requires Node 20.19+) andbetter-sqlite3@^12.0.0, same range as typeorm's own peer dependency.Tested with typeorm 0.3.x and 1.0.0, 13/13 passing on both. TAV run on my fork: https://github.com/katoztmy/opentelemetry-js-contrib/actions/runs/29142553352
I used AI assistance (Claude) for this change. I reviewed and tested everything myself.
This is my first contribution to this repo, so please let me know if I missed anything in the process.