Skip to content

Commit 17e463a

Browse files
authored
update nodejs autoinstrumetation, fixes #2626 (#3570)
* update nodejs autoinstrumetation, fix #2626 Signed-off-by: matteo.gazzetta <[email protected]> * fix: getResourceDetectorsFromEnv as getResourceDetectors export Signed-off-by: matteo.gazzetta <[email protected]> * refactor to use directly register from metapackage and simplify deps Signed-off-by: matteo.gazzetta <[email protected]> * fix dockerbuild Signed-off-by: matteo.gazzetta <[email protected]> * add backward compatibility with old operator * revert path nodejs instrumentation --------- Signed-off-by: matteo.gazzetta <[email protected]>
1 parent 3170c57 commit 17e463a

File tree

3 files changed

+7
-83
lines changed

3 files changed

+7
-83
lines changed

autoinstrumentation/nodejs/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ FROM busybox
2121
COPY --from=build /operator-build/build/workspace /autoinstrumentation
2222

2323
RUN chmod -R go+r /autoinstrumentation
24+
25+
# Backward compatibility with old operator version
26+
RUN cp -r /autoinstrumentation/node_modules/@opentelemetry/auto-instrumentations-node/build/src/. /autoinstrumentation
27+
RUN ln /autoinstrumentation/register.js /autoinstrumentation/autoinstrumentation.js

autoinstrumentation/nodejs/package.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
"private": true,
55
"scripts": {
66
"clean": "rimraf build/*",
7-
"prepare": "npm run compile",
8-
"compile": "tsc -p .",
9-
"postcompile": "copyfiles -f 'build/src/**' build/workspace/ && copyfiles 'node_modules/**' package.json build/workspace/ && npm -C build/workspace prune --omit=dev --no-package-lock"
7+
"postinstall": "copyfiles -f 'build/src/**' build/workspace/ && copyfiles 'node_modules/**' package.json build/workspace/ && npm -C build/workspace prune --omit=dev --no-package-lock"
108
},
119
"devDependencies": {
1210
"copyfiles": "^2.4.1",
1311
"rimraf": "^6.0.1",
1412
"typescript": "^5.6.3"
1513
},
1614
"dependencies": {
17-
"@opentelemetry/exporter-metrics-otlp-grpc": "0.55.0",
18-
"@opentelemetry/auto-instrumentations-node": "0.53.0",
19-
"@opentelemetry/exporter-prometheus": "0.55.0"
15+
"@opentelemetry/api": "1.9.0",
16+
"@opentelemetry/auto-instrumentations-node": "0.56.0"
2017
}
2118
}

autoinstrumentation/nodejs/src/autoinstrumentation.ts

-77
This file was deleted.

0 commit comments

Comments
 (0)