Skip to content

Commit 8db3837

Browse files
committed
support typeorm >=0.3.0 <1
1 parent 39ca9e9 commit 8db3837

File tree

5 files changed

+8
-31
lines changed

5 files changed

+8
-31
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
'typeorm':
2-
versions: ">0.2.28"
2+
versions: ">=0.3.0"
33
commands:
44
- npm run test

plugins/node/instrumentation-typeorm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-typeorm
1717

1818
### Supported versions
1919

20-
- `>=0.2.29 <1`
20+
- `>=0.3.0 <1`
2121

2222
## Usage
2323

plugins/node/instrumentation-typeorm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"author": "OpenTelemetry Authors",
3232
"license": "Apache-2.0",
3333
"engines": {
34-
"node": ">=16.13.0"
34+
"node": "^18.19.0 || >=20.6.0"
3535
},
3636
"files": [
3737
"build/src/**/*.js",

plugins/node/instrumentation-typeorm/src/typeorm.ts

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class TypeormInstrumentation extends InstrumentationBase<TypeormInstrumen
100100
protected init() {
101101
const selectQueryBuilder = new InstrumentationNodeModuleFile(
102102
'typeorm/query-builder/SelectQueryBuilder.js',
103-
['>=0.2.29 <1'],
103+
['>=0.3.0 <1'],
104104
moduleExports => {
105105
selectQueryBuilderExecuteMethods.map(method => {
106106
if (isWrapped(moduleExports.SelectQueryBuilder.prototype?.[method])) {
@@ -125,29 +125,6 @@ export class TypeormInstrumentation extends InstrumentationBase<TypeormInstrumen
125125
}
126126
);
127127

128-
const connection = new InstrumentationNodeModuleFile(
129-
'typeorm/connection/Connection.js',
130-
['>0.2.28 <0.3.0'],
131-
moduleExports => {
132-
if (isWrapped(moduleExports.Connection.prototype?.[rawQueryFuncName])) {
133-
this._unwrap(moduleExports.Connection.prototype, rawQueryFuncName);
134-
}
135-
this._wrap(
136-
moduleExports.Connection.prototype,
137-
rawQueryFuncName,
138-
this._patchRawQuery()
139-
);
140-
141-
return moduleExports;
142-
},
143-
moduleExports => {
144-
if (isWrapped(moduleExports.Connection.prototype?.[rawQueryFuncName])) {
145-
this._unwrap(moduleExports.Connection.prototype, rawQueryFuncName);
146-
}
147-
return moduleExports;
148-
}
149-
);
150-
151128
const dataSource = new InstrumentationNodeModuleFile(
152129
'typeorm/data-source/DataSource.js',
153130
['>=0.3.0 <1'],
@@ -173,7 +150,7 @@ export class TypeormInstrumentation extends InstrumentationBase<TypeormInstrumen
173150

174151
const entityManager = new InstrumentationNodeModuleFile(
175152
'typeorm/entity-manager/EntityManager.js',
176-
['>=0.2.29 <1'],
153+
['>=0.3.0 <1'],
177154
moduleExports => {
178155
entityManagerMethods.map(method => {
179156
if (isWrapped(moduleExports.EntityManager.prototype?.[method])) {
@@ -200,10 +177,10 @@ export class TypeormInstrumentation extends InstrumentationBase<TypeormInstrumen
200177

201178
const module = new InstrumentationNodeModuleDefinition(
202179
'typeorm',
203-
['>=0.2.29 <1'],
180+
['>=0.3.0 <1'],
204181
undefined,
205182
undefined,
206-
[selectQueryBuilder, entityManager, connection, dataSource]
183+
[selectQueryBuilder, entityManager, dataSource]
207184
);
208185
return module;
209186
}

0 commit comments

Comments
 (0)