From e01b1d3559c6080de971a8ff347c5e526b1a272e Mon Sep 17 00:00:00 2001 From: Noemi <45180344+unflxw@users.noreply.github.com> Date: Fri, 4 Nov 2022 13:56:40 +0100 Subject: [PATCH] Add MongoDB instrumentation Add the `@opentelemetry/instrumentation-mongodb` dependency and add the `MongoDBInstrumentation` to the default instrumentation list. --- .changesets/add-mongodb-instrumentation.md | 6 + package-lock.json | 234 +++++++++------------ package.json | 7 +- src/client.ts | 2 + 4 files changed, 117 insertions(+), 132 deletions(-) create mode 100644 .changesets/add-mongodb-instrumentation.md diff --git a/.changesets/add-mongodb-instrumentation.md b/.changesets/add-mongodb-instrumentation.md new file mode 100644 index 00000000..6eccff87 --- /dev/null +++ b/.changesets/add-mongodb-instrumentation.md @@ -0,0 +1,6 @@ +--- +bump: "patch" +type: "add" +--- + +Add MongoDB instrumentation diff --git a/package-lock.json b/package-lock.json index 7fa1d78c..6b68cbde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@appsignal/nodejs", - "version": "3.0.0-beta.4", + "version": "3.0.0-beta.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@appsignal/nodejs", - "version": "3.0.0-beta.4", + "version": "3.0.0-beta.5", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -18,6 +18,7 @@ "@opentelemetry/instrumentation-http": "^0.32.0", "@opentelemetry/instrumentation-ioredis": "^0.32.1", "@opentelemetry/instrumentation-koa": "^0.33.0", + "@opentelemetry/instrumentation-mongodb": "0.32.2", "@opentelemetry/instrumentation-mongoose": "^0.31.0", "@opentelemetry/instrumentation-mysql": "^0.31.1", "@opentelemetry/instrumentation-mysql2": "^0.32.0", @@ -1340,34 +1341,6 @@ "@opentelemetry/api": "^1.0.0" } }, - "node_modules/@opentelemetry/instrumentation-fs/node_modules/@opentelemetry/api-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.32.0.tgz", - "integrity": "sha512-g1WLhpG8B6iuDyZJFRGsR+JKyZ94m5LEmY2f+duEJ9Xb4XRlLHrZvh6G34OH6GJ8iDHxfHb/sWjJ1ZpkI9yGMQ==", - "dependencies": { - "@opentelemetry/api": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation-fs/node_modules/@opentelemetry/instrumentation": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.32.0.tgz", - "integrity": "sha512-y6ADjHpkUz/v1nkyyYjsQa/zorhX+0qVGpFvXMcbjU4sHnBnC02c6wcc93sIgZfiQClIWo45TGku1KQxJ5UUbQ==", - "dependencies": { - "@opentelemetry/api-metrics": "0.32.0", - "require-in-the-middle": "^5.0.3", - "semver": "^7.3.2", - "shimmer": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0" - } - }, "node_modules/@opentelemetry/instrumentation-graphql": { "version": "0.31.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.31.0.tgz", @@ -1434,6 +1407,21 @@ "@opentelemetry/api": "^1.0.0" } }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.32.2.tgz", + "integrity": "sha512-C3OWsc1Fan+xl+ly0C8VxiICb30xevoG82Ytx+4LOemiZc37WPcTdJMrXi2MyOtRc7kqN6xYf2zbU/n+y8BsUQ==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/semantic-conventions": "^1.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0" + } + }, "node_modules/@opentelemetry/instrumentation-mongoose": { "version": "0.31.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.31.0.tgz", @@ -7213,24 +7201,6 @@ "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==" }, - "node_modules/mongodb": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.8.1.tgz", - "integrity": "sha512-/NyiM3Ox9AwP5zrfT9TXjRKDJbXlLaUDQ9Rg//2lbg8D2A8GXV0VidYYnA/gfdK6uwbnL4FnAflH7FbGw3TS7w==", - "dev": true, - "dependencies": { - "bson": "^4.6.5", - "denque": "^2.0.1", - "mongodb-connection-string-url": "^2.5.2", - "socks": "^2.6.2" - }, - "engines": { - "node": ">=12.9.0" - }, - "optionalDependencies": { - "saslprep": "^1.0.3" - } - }, "node_modules/mongodb-connection-string-url": { "version": "2.5.4", "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.4.tgz", @@ -7297,6 +7267,24 @@ "url": "https://opencollective.com/mongoose" } }, + "node_modules/mongoose/node_modules/mongodb": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.8.1.tgz", + "integrity": "sha512-/NyiM3Ox9AwP5zrfT9TXjRKDJbXlLaUDQ9Rg//2lbg8D2A8GXV0VidYYnA/gfdK6uwbnL4FnAflH7FbGw3TS7w==", + "dev": true, + "dependencies": { + "bson": "^4.6.5", + "denque": "^2.0.1", + "mongodb-connection-string-url": "^2.5.2", + "socks": "^2.6.2" + }, + "engines": { + "node": ">=12.9.0" + }, + "optionalDependencies": { + "saslprep": "^1.0.3" + } + }, "node_modules/mongoose/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -12004,7 +11992,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.7.0.tgz", "integrity": "sha512-AVqAi5uc8DrKJBimCTFUT4iFI+5eXpo4sYmGbQ0CypG0piOTHE2g9c5aSoTGYXu3CzOmJZf7pT6Xh+nwm5d6yQ==", "requires": { - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/instrumentation": { @@ -12012,7 +12000,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.33.0.tgz", "integrity": "sha512-8joPjKJ6TznNt04JbnzZG+m1j/4wm1OIrX7DEw/V5lyZ9/2fahIqG72jeZ26VKOZnLOpVzUUnU/dweURqBzT3Q==", "requires": { - "@opentelemetry/api-metrics": "0.33.0", + "@opentelemetry/api-metrics": "^0.33.0", "require-in-the-middle": "^5.0.3", "semver": "^7.3.2", "shimmer": "^1.2.1" @@ -12023,9 +12011,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.31.2.tgz", "integrity": "sha512-+/H/D3N65FyBCwSm0Kql45Ok2wgnDBKGqfijdRpgoDJc70P3trvE2zygcDGsnVDmNnrjJdjyk4W1pyav7kRTpA==", "requires": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/express": "4.17.13" } }, @@ -12034,9 +12022,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.30.0.tgz", "integrity": "sha512-PxhGVEm1dddEa6/SxCEGsHMwV1wvvfL8LWYmj6YKjY0N/CJumaRu42K+uOPvo1T5Uz5PMmTbVAa9aMLVH/gQMA==", "requires": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "fastify": "^4.5.3" } }, @@ -12045,30 +12033,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.5.1.tgz", "integrity": "sha512-aGG/E6Yh74PuenV5YsMTjB8FN8+l4g0Fu9vc9mEvyR9s72nzk63CO5+BqpyKi8N0JDr597/XRo82PLNaq4NpXQ==", "requires": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0" - }, - "dependencies": { - "@opentelemetry/api-metrics": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.32.0.tgz", - "integrity": "sha512-g1WLhpG8B6iuDyZJFRGsR+JKyZ94m5LEmY2f+duEJ9Xb4XRlLHrZvh6G34OH6GJ8iDHxfHb/sWjJ1ZpkI9yGMQ==", - "requires": { - "@opentelemetry/api": "^1.0.0" - } - }, - "@opentelemetry/instrumentation": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.32.0.tgz", - "integrity": "sha512-y6ADjHpkUz/v1nkyyYjsQa/zorhX+0qVGpFvXMcbjU4sHnBnC02c6wcc93sIgZfiQClIWo45TGku1KQxJ5UUbQ==", - "requires": { - "@opentelemetry/api-metrics": "0.32.0", - "require-in-the-middle": "^5.0.3", - "semver": "^7.3.2", - "shimmer": "^1.2.1" - } - } + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/instrumentation-graphql": { @@ -12076,7 +12043,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.31.0.tgz", "integrity": "sha512-l8Vzu7xp0ybRNao8T59B1wp7MB9yaxTMeF1ETv+YWdYgQcDGLI7f5fb737645ArODBd2DtDsZZwJoyAsfFUyFQ==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.33.0", "graphql": "^15.5.1" } }, @@ -12085,9 +12052,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.32.0.tgz", "integrity": "sha512-EbNdJl6IjouphbxPVGV8/utiqB2DhveyH5TD6vxjc2OXlQ3A/mKg3fYSSWB+rYQBuuli+jWQfBJe2ntOFZtTMw==", "requires": { - "@opentelemetry/core": "1.6.0", - "@opentelemetry/instrumentation": "0.32.0", - "@opentelemetry/semantic-conventions": "1.6.0", + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "semver": "^7.3.5" } }, @@ -12096,8 +12063,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.32.1.tgz", "integrity": "sha512-0b2l8S72AF9wIgZGCs8q91iRCn5tww60j3FSURSyfjSIVIu3A2fYGPvT2L1XrJ4AsD0Mi4L4OWI3yq+630xR2g==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/ioredis": "4.26.6" } }, @@ -12106,21 +12073,30 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.33.0.tgz", "integrity": "sha512-b0+1polkk/q2xS+Hla4YG9UbRZyOQoUkm2/ybEM7qLeXzq98m6GL4ss5mj6mJJSU7r6iWxF8Nx5t0p2KZd70UA==", "requires": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/koa": "2.13.4", "@types/koa__router": "8.0.7" } }, + "@opentelemetry/instrumentation-mongodb": { + "version": "0.32.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.32.2.tgz", + "integrity": "sha512-C3OWsc1Fan+xl+ly0C8VxiICb30xevoG82Ytx+4LOemiZc37WPcTdJMrXi2MyOtRc7kqN6xYf2zbU/n+y8BsUQ==", + "requires": { + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" + } + }, "@opentelemetry/instrumentation-mongoose": { "version": "0.31.0", "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.31.0.tgz", "integrity": "sha512-Y9th3we9D6Gx1fJYBNrDpVPe4Sl3AGYbmqA7OnUMsbNqPFaa5ghJsPNI7NWF8f6q03YjiT8w1DeWtr6bNOK56w==", "requires": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/instrumentation-mysql": { @@ -12128,8 +12104,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.31.1.tgz", "integrity": "sha512-vEa/0Hs5uOJKS5fUozCJhQ37HOH2JWqkFm1D0w3R4GdoUyA/beoAbFy1CftSxjQkqgF9Wjc7o7L/F9vBTGyZYg==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/mysql": "2.15.19" } }, @@ -12138,8 +12114,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.32.0.tgz", "integrity": "sha512-ApiDswZiaNR+JnGEPU7TtwHaGtGmnACc6pyKmeMEgEuB1VR7dRZLyztgiOz7NNFsCLSDkW24XMZ/wrBgJUvz4g==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/instrumentation-nestjs-core": { @@ -12147,8 +12123,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.31.0.tgz", "integrity": "sha512-Un3uPLS8wZAMMiz1PAiSX7+QfWaEUF7ejTZEybanwHCROv2zMa4P/cCc2WFAMm6q82brV6f4OqPEYLP+AnombQ==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/instrumentation-pg": { @@ -12156,8 +12132,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.31.1.tgz", "integrity": "sha512-MpPaTkAIi7EE/2BMNjbk0ChS1eGS3FF/+UFriAbqONkLBZ6wE1+TDrcZDjnmylKRULbVR5rqEn6/OeGopD/THA==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/pg": "8.6.1", "@types/pg-pool": "2.0.3" } @@ -12167,8 +12143,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.33.0.tgz", "integrity": "sha512-wcPJ5tp4wspsr0uQ6WmEue83qlXzeF2EJzKR0Ye/8VQCJsRmSmOnEIEC33UPwlCzfssz/t8EdqU3ejx+uTa00Q==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0", + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0", "@types/redis": "2.8.31" } }, @@ -12177,8 +12153,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.33.0.tgz", "integrity": "sha512-q6qM3+8T0rLHJyD297dWukm9nvIOyjVn/KjfzeVQgkAcoPUWm+xTIjiMips1ZVz0ZXF2x+1CodTdPvFpknx3mA==", "requires": { - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/semantic-conventions": "^1.0.0" + "@opentelemetry/instrumentation": "^0.33.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/propagator-b3": { @@ -12186,7 +12162,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-b3/-/propagator-b3-1.7.0.tgz", "integrity": "sha512-8kKGS1KwArvkThdhubMZlomuREE9FaBcn9L4JrYHh2jly1FZpqOtFNO2byHymVRjH59d43Pa+eJuFpD0Fp7kSw==", "requires": { - "@opentelemetry/core": "1.7.0" + "@opentelemetry/core": "^1.7.0" } }, "@opentelemetry/propagator-jaeger": { @@ -12194,7 +12170,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.7.0.tgz", "integrity": "sha512-V7i/L1bx+R/ve4z6dTdn2jtvFxGThRsXS2wNb/tWZVfV8gqnePQp+HfoLrqB/Yz2iRPUcMWrcjx6vV78umvJFA==", "requires": { - "@opentelemetry/core": "1.7.0" + "@opentelemetry/core": "^1.7.0" } }, "@opentelemetry/resources": { @@ -12202,8 +12178,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.7.0.tgz", "integrity": "sha512-u1M0yZotkjyKx8dj+46Sg5thwtOTBmtRieNXqdCRiWUp6SfFiIP0bI+1XK3LhuXqXkBXA1awJZaTqKduNMStRg==", "requires": { - "@opentelemetry/core": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/sdk-metrics": { @@ -12211,8 +12187,8 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-0.33.0.tgz", "integrity": "sha512-ZXPixOlTd/FHLwpkmm5nTpJE7bZOPfmbSz8hBVFCEHkXE1aKEKaM38UFnZ+2xzOY1tDsDwyxEiiBiDX8y3039A==", "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", + "@opentelemetry/api-metrics": "^0.33.0", + "@opentelemetry/core": "^1.7.0", "@opentelemetry/resources": "1.7.0", "lodash.merge": "4.6.2" } @@ -12222,9 +12198,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-node/-/sdk-node-0.33.0.tgz", "integrity": "sha512-wcXimvZOrFz+mRORoq+9OIusqoP8bnqbSF6U2XRUMQX986UoM6dAjwB5cslyRbrN4Feju+6tp70g6HTdl6BYMA==", "requires": { - "@opentelemetry/api-metrics": "0.33.0", - "@opentelemetry/core": "1.7.0", - "@opentelemetry/instrumentation": "0.33.0", + "@opentelemetry/api-metrics": "^0.33.0", + "@opentelemetry/core": "^1.7.0", + "@opentelemetry/instrumentation": "^0.33.0", "@opentelemetry/resources": "1.7.0", "@opentelemetry/sdk-metrics": "0.33.0", "@opentelemetry/sdk-trace-base": "1.7.0", @@ -12236,9 +12212,9 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.7.0.tgz", "integrity": "sha512-Iz84C+FVOskmauh9FNnj4+VrA+hG5o+tkMzXuoesvSfunVSioXib0syVFeNXwOm4+M5GdWCuW632LVjqEXStIg==", "requires": { - "@opentelemetry/core": "1.7.0", + "@opentelemetry/core": "^1.7.0", "@opentelemetry/resources": "1.7.0", - "@opentelemetry/semantic-conventions": "1.7.0" + "@opentelemetry/semantic-conventions": "^1.7.0" } }, "@opentelemetry/sdk-trace-node": { @@ -12247,7 +12223,7 @@ "integrity": "sha512-DCAAbi0Zbb1pIofQcKzoAVy9/6bz24asFYeLb4fW/8QYAaawDnxumA++5Huw/RcYdJs8q8AIRBykwjYWWCm/5A==", "requires": { "@opentelemetry/context-async-hooks": "1.7.0", - "@opentelemetry/core": "1.7.0", + "@opentelemetry/core": "^1.7.0", "@opentelemetry/propagator-b3": "1.7.0", "@opentelemetry/propagator-jaeger": "1.7.0", "@opentelemetry/sdk-trace-base": "1.7.0", @@ -16492,19 +16468,6 @@ "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==" }, - "mongodb": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.8.1.tgz", - "integrity": "sha512-/NyiM3Ox9AwP5zrfT9TXjRKDJbXlLaUDQ9Rg//2lbg8D2A8GXV0VidYYnA/gfdK6uwbnL4FnAflH7FbGw3TS7w==", - "dev": true, - "requires": { - "bson": "^4.6.5", - "denque": "^2.0.1", - "mongodb-connection-string-url": "^2.5.2", - "saslprep": "^1.0.3", - "socks": "^2.6.2" - } - }, "mongodb-connection-string-url": { "version": "2.5.4", "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.4.tgz", @@ -16557,6 +16520,19 @@ "sift": "16.0.0" }, "dependencies": { + "mongodb": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.8.1.tgz", + "integrity": "sha512-/NyiM3Ox9AwP5zrfT9TXjRKDJbXlLaUDQ9Rg//2lbg8D2A8GXV0VidYYnA/gfdK6uwbnL4FnAflH7FbGw3TS7w==", + "dev": true, + "requires": { + "bson": "^4.6.5", + "denque": "^2.0.1", + "mongodb-connection-string-url": "^2.5.2", + "saslprep": "^1.0.3", + "socks": "^2.6.2" + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/package.json b/package.json index 558cb3be..500994b5 100644 --- a/package.json +++ b/package.json @@ -13,15 +13,14 @@ }, "dependencies": { "@opentelemetry/api": "^1.2.0", - "@opentelemetry/sdk-node": "^0.33.0", - "@opentelemetry/sdk-trace-base": "^1.7.0", + "@opentelemetry/instrumentation-express": "^0.31.2", "@opentelemetry/instrumentation-fastify": "^0.30.0", "@opentelemetry/instrumentation-fs": "^0.5.1", - "@opentelemetry/instrumentation-express": "^0.31.2", "@opentelemetry/instrumentation-graphql": "^0.31.0", "@opentelemetry/instrumentation-http": "^0.32.0", "@opentelemetry/instrumentation-ioredis": "^0.32.1", "@opentelemetry/instrumentation-koa": "^0.33.0", + "@opentelemetry/instrumentation-mongodb": "0.32.2", "@opentelemetry/instrumentation-mongoose": "^0.31.0", "@opentelemetry/instrumentation-mysql": "^0.31.1", "@opentelemetry/instrumentation-mysql2": "^0.32.0", @@ -29,6 +28,8 @@ "@opentelemetry/instrumentation-pg": "^0.31.1", "@opentelemetry/instrumentation-redis": "^0.33.0", "@opentelemetry/instrumentation-redis-4": "^0.33.0", + "@opentelemetry/sdk-node": "^0.33.0", + "@opentelemetry/sdk-trace-base": "^1.7.0", "@prisma/instrumentation": "^4.4.0", "node-addon-api": "^3.1.0", "node-gyp": "^9.0.0", diff --git a/src/client.ts b/src/client.ts index 56b58dfb..228a686c 100644 --- a/src/client.ts +++ b/src/client.ts @@ -20,6 +20,7 @@ import { GraphQLInstrumentation } from "@opentelemetry/instrumentation-graphql" import { HttpInstrumentation } from "@opentelemetry/instrumentation-http" import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis" import { KoaInstrumentation } from "@opentelemetry/instrumentation-koa" +import { MongoDBInstrumentation } from "@opentelemetry/instrumentation-mongodb" import { MongooseInstrumentation } from "@opentelemetry/instrumentation-mongoose" import { MySQL2Instrumentation } from "@opentelemetry/instrumentation-mysql2" import { MySQLInstrumentation } from "@opentelemetry/instrumentation-mysql" @@ -41,6 +42,7 @@ const DefaultInstrumentations = { "@opentelemetry/instrumentation-http": HttpInstrumentation, "@opentelemetry/instrumentation-ioredis": IORedisInstrumentation, "@opentelemetry/instrumentation-koa": KoaInstrumentation, + "@opentelemetry/instrumentation-mongodb": MongoDBInstrumentation, "@opentelemetry/instrumentation-mongoose": MongooseInstrumentation, "@opentelemetry/instrumentation-mysql2": MySQL2Instrumentation, "@opentelemetry/instrumentation-mysql": MySQLInstrumentation,