diff --git a/.github/component_owners.yml b/.github/component_owners.yml index db61e7824a..713bea0bfa 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -45,6 +45,8 @@ components: - pichlermarc - legendecas - blumamir + packages/winston-transport: + - hectorhdzg plugins/node/instrumentation-amqplib: - blumamir plugins/node/instrumentation-cucumber: diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1ceba1474e..5dc8b7e1bb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.28.7","detectors/node/opentelemetry-resource-detector-aws":"1.4.0","detectors/node/opentelemetry-resource-detector-azure":"0.2.5","detectors/node/opentelemetry-resource-detector-container":"0.3.7","detectors/node/opentelemetry-resource-detector-gcp":"0.29.7","detectors/node/opentelemetry-resource-detector-github":"0.28.1","detectors/node/opentelemetry-resource-detector-instana":"0.7.0","metapackages/auto-instrumentations-node":"0.43.0","metapackages/auto-instrumentations-web":"0.37.0","packages/opentelemetry-host-metrics":"0.35.0","packages/opentelemetry-id-generator-aws-xray":"1.2.1","packages/opentelemetry-propagation-utils":"0.30.7","packages/opentelemetry-redis-common":"0.36.1","packages/opentelemetry-sql-common":"0.40.0","packages/opentelemetry-test-utils":"0.37.0","plugins/node/instrumentation-amqplib":"0.35.0","plugins/node/instrumentation-cucumber":"0.4.0","plugins/node/instrumentation-dataloader":"0.7.0","plugins/node/instrumentation-fs":"0.10.0","plugins/node/instrumentation-lru-memoizer":"0.35.0","plugins/node/instrumentation-mongoose":"0.36.0","plugins/node/instrumentation-runtime-node":"0.2.1","plugins/node/instrumentation-socket.io":"0.37.0","plugins/node/instrumentation-tedious":"0.8.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.39.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.39.1","plugins/node/opentelemetry-instrumentation-bunyan":"0.36.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.36.0","plugins/node/opentelemetry-instrumentation-connect":"0.34.0","plugins/node/opentelemetry-instrumentation-dns":"0.34.0","plugins/node/opentelemetry-instrumentation-express":"0.36.1","plugins/node/opentelemetry-instrumentation-fastify":"0.34.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.34.0","plugins/node/opentelemetry-instrumentation-graphql":"0.38.1","plugins/node/opentelemetry-instrumentation-hapi":"0.35.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.38.0","plugins/node/opentelemetry-instrumentation-knex":"0.34.0","plugins/node/opentelemetry-instrumentation-koa":"0.38.0","plugins/node/opentelemetry-instrumentation-memcached":"0.34.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.41.0","plugins/node/opentelemetry-instrumentation-mysql":"0.36.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.36.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.35.0","plugins/node/opentelemetry-instrumentation-net":"0.34.0","plugins/node/opentelemetry-instrumentation-pg":"0.39.1","plugins/node/opentelemetry-instrumentation-pino":"0.36.0","plugins/node/opentelemetry-instrumentation-redis":"0.37.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.37.0","plugins/node/opentelemetry-instrumentation-restify":"0.36.0","plugins/node/opentelemetry-instrumentation-router":"0.35.0","plugins/node/opentelemetry-instrumentation-winston":"0.35.0","plugins/web/opentelemetry-instrumentation-document-load":"0.36.0","plugins/web/opentelemetry-instrumentation-long-task":"0.36.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.36.0","plugins/web/opentelemetry-plugin-react-load":"0.30.0","propagators/opentelemetry-propagator-aws-xray":"1.3.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.27.1","propagators/opentelemetry-propagator-instana":"0.3.1","propagators/opentelemetry-propagator-ot-trace":"0.27.1"} +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.28.7","detectors/node/opentelemetry-resource-detector-aws":"1.4.0","detectors/node/opentelemetry-resource-detector-azure":"0.2.5","detectors/node/opentelemetry-resource-detector-container":"0.3.7","detectors/node/opentelemetry-resource-detector-gcp":"0.29.7","detectors/node/opentelemetry-resource-detector-github":"0.28.1","detectors/node/opentelemetry-resource-detector-instana":"0.7.0","metapackages/auto-instrumentations-node":"0.43.0","metapackages/auto-instrumentations-web":"0.37.0","packages/opentelemetry-host-metrics":"0.35.0","packages/opentelemetry-id-generator-aws-xray":"1.2.1","packages/opentelemetry-propagation-utils":"0.30.7","packages/opentelemetry-redis-common":"0.36.1","packages/opentelemetry-sql-common":"0.40.0","packages/opentelemetry-test-utils":"0.37.0","packages/winston-transport": "0.1.0","plugins/node/instrumentation-amqplib":"0.35.0","plugins/node/instrumentation-cucumber":"0.4.0","plugins/node/instrumentation-dataloader":"0.7.0","plugins/node/instrumentation-fs":"0.10.0","plugins/node/instrumentation-lru-memoizer":"0.35.0","plugins/node/instrumentation-mongoose":"0.36.0","plugins/node/instrumentation-runtime-node":"0.2.1","plugins/node/instrumentation-socket.io":"0.37.0","plugins/node/instrumentation-tedious":"0.8.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.39.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.39.1","plugins/node/opentelemetry-instrumentation-bunyan":"0.36.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.36.0","plugins/node/opentelemetry-instrumentation-connect":"0.34.0","plugins/node/opentelemetry-instrumentation-dns":"0.34.0","plugins/node/opentelemetry-instrumentation-express":"0.36.1","plugins/node/opentelemetry-instrumentation-fastify":"0.34.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.34.0","plugins/node/opentelemetry-instrumentation-graphql":"0.38.1","plugins/node/opentelemetry-instrumentation-hapi":"0.35.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.38.0","plugins/node/opentelemetry-instrumentation-knex":"0.34.0","plugins/node/opentelemetry-instrumentation-koa":"0.38.0","plugins/node/opentelemetry-instrumentation-memcached":"0.34.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.41.0","plugins/node/opentelemetry-instrumentation-mysql":"0.36.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.36.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.35.0","plugins/node/opentelemetry-instrumentation-net":"0.34.0","plugins/node/opentelemetry-instrumentation-pg":"0.39.1","plugins/node/opentelemetry-instrumentation-pino":"0.36.0","plugins/node/opentelemetry-instrumentation-redis":"0.37.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.37.0","plugins/node/opentelemetry-instrumentation-restify":"0.36.0","plugins/node/opentelemetry-instrumentation-router":"0.35.0","plugins/node/opentelemetry-instrumentation-winston":"0.35.0","plugins/web/opentelemetry-instrumentation-document-load":"0.36.0","plugins/web/opentelemetry-instrumentation-long-task":"0.36.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.36.0","plugins/web/opentelemetry-plugin-react-load":"0.30.0","propagators/opentelemetry-propagator-aws-xray":"1.3.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.27.1","propagators/opentelemetry-propagator-instana":"0.3.1","propagators/opentelemetry-propagator-ot-trace":"0.27.1"} diff --git a/package-lock.json b/package-lock.json index 128fdd3049..3db09a62fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6762,20 +6762,6 @@ "set-blocking": "^2.0.0" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -6791,15 +6777,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@mapbox/node-pre-gyp/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/@mdn/browser-compat-data": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-4.2.1.tgz", @@ -8797,6 +8774,10 @@ "resolved": "packages/opentelemetry-sql-common", "link": true }, + "node_modules/@opentelemetry/winston-transport": { + "resolved": "packages/winston-transport", + "link": true + }, "node_modules/@parcel/watcher": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", @@ -10815,8 +10796,7 @@ "node_modules/@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "dev": true + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" }, "node_modules/@types/uuid": { "version": "9.0.1", @@ -12145,29 +12125,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -12965,29 +12922,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/bl/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -13146,29 +13080,6 @@ "node": ">= 4" } }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/browserify-sign/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/browserify-zlib": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", @@ -14447,29 +14358,6 @@ "typedarray": "^0.0.6" } }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/config-chain": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", @@ -14874,8 +14762,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cors": { "version": "2.8.5", @@ -17603,15 +17490,6 @@ "node": ">= 10.x" } }, - "node_modules/fastify/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -17633,8 +17511,7 @@ "node_modules/fecha": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "dev": true + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, "node_modules/figgy-pudding": { "version": "3.5.2", @@ -19208,29 +19085,6 @@ "node": ">=4" } }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hash-base/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -19733,8 +19587,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "2.0.0", @@ -23463,7 +23316,6 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz", "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==", - "dev": true, "dependencies": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -23480,7 +23332,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "dev": true, "engines": { "node": ">=0.1.90" } @@ -26440,15 +26291,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/node-libs-browser/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/node-libs-browser/node_modules/url": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", @@ -28825,15 +28667,6 @@ "node": ">= 10.x" } }, - "node_modules/pino-abstract-transport/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", @@ -29900,10 +29733,9 @@ } }, "node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dev": true, + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -29914,8 +29746,12 @@ "node_modules/readable-stream/node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/readable-stream/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" }, "node_modules/readdirp": { "version": "3.6.0", @@ -30528,15 +30364,6 @@ "node": ">= 10.x" } }, - "node_modules/restify/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/restify/node_modules/uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -30863,7 +30690,6 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", - "dev": true, "engines": { "node": ">=10" } @@ -31945,29 +31771,6 @@ "wbuf": "^1.7.3" } }, - "node_modules/spdy-transport/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/spdy-transport/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", @@ -32026,29 +31829,6 @@ "readable-stream": "^3.0.0" } }, - "node_modules/split2/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/split2/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", @@ -32509,10 +32289,13 @@ } }, "node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "dev": true + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } }, "node_modules/string-argv": { "version": "0.3.2", @@ -32865,29 +32648,6 @@ "node": ">=6" } }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/tar-stream/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -33029,29 +32789,6 @@ } ] }, - "node_modules/tedious/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/tedious/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -33673,29 +33410,6 @@ "readable-stream": "3" } }, - "node_modules/through2/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/tildify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/tildify/-/tildify-2.0.0.tgz", @@ -33957,7 +33671,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "dev": true, "engines": { "node": ">= 14.0.0" } @@ -36043,7 +35756,6 @@ "version": "4.7.0", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz", "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==", - "dev": true, "dependencies": { "logform": "^2.3.2", "readable-stream": "^3.6.0", @@ -36053,52 +35765,6 @@ "node": ">= 12.0.0" } }, - "node_modules/winston-transport/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/winston-transport/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/winston/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/winston/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/winston2": { "name": "winston", "version": "2.4.7", @@ -37003,6 +36669,36 @@ "@opentelemetry/api": "^1.3.0" } }, + "packages/winston-transport": { + "name": "@opentelemetry/winston-transport", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/api-logs": "^0.49.1", + "winston-transport": "4.*" + }, + "devDependencies": { + "@types/mocha": "7.0.2", + "@types/node": "18.6.5", + "@types/sinon": "10.0.18", + "@types/triple-beam": "1.3.2", + "mocha": "7.2.0", + "nyc": "15.1.0", + "rimraf": "5.0.5", + "sinon": "15.2.0", + "ts-mocha": "10.0.0", + "typescript": "4.4.4" + }, + "engines": { + "node": ">=14" + } + }, + "packages/winston-transport/node_modules/@types/triple-beam": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", + "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==", + "dev": true + }, "plugins/node/instrumentation-amqplib": { "name": "@opentelemetry/instrumentation-amqplib", "version": "0.35.0", @@ -38996,9 +38692,10 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/sdk-trace-node": "^1.8.0", + "@opentelemetry/context-async-hooks": "^1.21.0", + "@opentelemetry/sdk-trace-base": "^1.21.0", + "@opentelemetry/sdk-trace-node": "^1.21.0", + "@opentelemetry/winston-transport": "^0.1.0", "@types/mocha": "7.0.2", "@types/node": "18.6.5", "@types/sinon": "10.0.18", @@ -44778,17 +44475,6 @@ "set-blocking": "^2.0.0" } }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -44797,15 +44483,6 @@ "requires": { "glob": "^7.1.3" } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, @@ -47648,10 +47325,11 @@ "version": "file:plugins/node/opentelemetry-instrumentation-winston", "requires": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-async-hooks": "^1.8.0", + "@opentelemetry/context-async-hooks": "^1.21.0", "@opentelemetry/instrumentation": "^0.49.1", - "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/sdk-trace-node": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.21.0", + "@opentelemetry/sdk-trace-node": "^1.21.0", + "@opentelemetry/winston-transport": "^0.1.0", "@types/mocha": "7.0.2", "@types/node": "18.6.5", "@types/sinon": "10.0.18", @@ -48356,6 +48034,31 @@ "typescript": "4.4.4" } }, + "@opentelemetry/winston-transport": { + "version": "file:packages/winston-transport", + "requires": { + "@opentelemetry/api-logs": "^0.49.1", + "@types/mocha": "7.0.2", + "@types/node": "18.6.5", + "@types/sinon": "10.0.18", + "@types/triple-beam": "1.3.2", + "mocha": "7.2.0", + "nyc": "15.1.0", + "rimraf": "5.0.5", + "sinon": "15.2.0", + "ts-mocha": "10.0.0", + "typescript": "4.4.4", + "winston-transport": "4.*" + }, + "dependencies": { + "@types/triple-beam": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.2.tgz", + "integrity": "sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g==", + "dev": true + } + } + }, "@parcel/watcher": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", @@ -50069,8 +49772,7 @@ "@types/triple-beam": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "dev": true + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" }, "@types/uuid": { "version": "9.0.1", @@ -51118,28 +50820,6 @@ "requires": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "argparse": { @@ -51757,26 +51437,6 @@ "base64-js": "^1.3.1", "ieee754": "^1.1.13" } - }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, @@ -51928,28 +51588,6 @@ "parse-asn1": "^5.1.6", "readable-stream": "^3.6.2", "safe-buffer": "^5.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "browserify-zlib": { @@ -52918,28 +52556,6 @@ "inherits": "^2.0.3", "readable-stream": "^3.0.2", "typedarray": "^0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "config-chain": { @@ -53281,8 +52897,7 @@ "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "cors": { "version": "2.8.5", @@ -55440,15 +55055,6 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, @@ -55479,8 +55085,7 @@ "fecha": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "dev": true + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, "figgy-pudding": { "version": "3.5.2", @@ -56690,28 +56295,6 @@ "inherits": "^2.0.4", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "hash.js": { @@ -57128,8 +56711,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "2.0.0", @@ -60031,7 +59613,6 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz", "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==", - "dev": true, "requires": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -60044,8 +59625,7 @@ "@colors/colors": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "dev": true + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==" } } }, @@ -62480,15 +62060,6 @@ } } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, "url": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/url/-/url-0.11.3.tgz", @@ -64322,15 +63893,6 @@ "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, @@ -65167,10 +64729,9 @@ } }, "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dev": true, + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.1", @@ -65181,8 +64742,12 @@ "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" } } }, @@ -65626,15 +65191,6 @@ "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "dev": true }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, "uuid": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", @@ -65895,8 +65451,7 @@ "safe-stable-stringify": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", - "dev": true + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==" }, "safer-buffer": { "version": "2.1.2", @@ -66796,28 +66351,6 @@ "obuf": "^1.1.2", "readable-stream": "^3.0.6", "wbuf": "^1.7.3" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "split": { @@ -66866,28 +66399,6 @@ "dev": true, "requires": { "readable-stream": "^3.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "sprintf-js": { @@ -67273,10 +66784,13 @@ } }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "dev": true + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } }, "string-argv": { "version": "0.3.2", @@ -67556,28 +67070,6 @@ "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "tarn": { @@ -67641,26 +67133,6 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true - }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, @@ -68145,28 +67617,6 @@ "dev": true, "requires": { "readable-stream": "3" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "tildify": { @@ -68369,8 +67819,7 @@ "triple-beam": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", - "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "dev": true + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==" }, "ts-loader": { "version": "8.3.0", @@ -70003,61 +69452,16 @@ "stack-trace": "0.0.x", "triple-beam": "^1.3.0", "winston-transport": "^4.4.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "winston-transport": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz", "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==", - "dev": true, "requires": { "logform": "^2.3.2", "readable-stream": "^3.6.0", "triple-beam": "^1.3.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } } }, "winston2": { diff --git a/packages/winston-transport/.eslintignore b/packages/winston-transport/.eslintignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/packages/winston-transport/.eslintignore @@ -0,0 +1 @@ +build diff --git a/packages/winston-transport/.eslintrc.js b/packages/winston-transport/.eslintrc.js new file mode 100644 index 0000000000..f726f3becb --- /dev/null +++ b/packages/winston-transport/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + "env": { + "mocha": true, + "node": true + }, + ...require('../../eslint.config.js') +} diff --git a/packages/winston-transport/CHANGELOG.md b/packages/winston-transport/CHANGELOG.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/winston-transport/LICENSE b/packages/winston-transport/LICENSE new file mode 100644 index 0000000000..e50e8c80f9 --- /dev/null +++ b/packages/winston-transport/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2022] OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/winston-transport/README.md b/packages/winston-transport/README.md new file mode 100644 index 0000000000..6bfa2079c0 --- /dev/null +++ b/packages/winston-transport/README.md @@ -0,0 +1,70 @@ +# OpenTelemetry transport for winston + +[![NPM Published Version][npm-img]][npm-url] +[![Apache License][license-image]][license-image] + +This module provides a Transport for [`winston`](https://www.npmjs.com/package/winston) module to send Winston logging to the OpenTelemetry Logging SDK. + +Compatible with OpenTelemetry JS API and SDK `1.0+`. + +## Installation + +```bash +npm install --save @opentelemetry/winston-transport +``` + +## Usage + +This package exports the Winston transport class that is used to send records to the +OpenTelemetry Logs SDK. It can be used directly when configuring a Winston logger. If using +[`@opentelemetry/instrumenation-winston`](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-winston) +package there is no need to instantiate the transport as the instrumentation will take care of that. +For example: + +```js +const logsAPI = require('@opentelemetry/api-logs'); +const { + LoggerProvider, + SimpleLogRecordProcessor, + ConsoleLogRecordExporter, +} = require('@opentelemetry/sdk-logs'); +const { OpenTelemetryTransportV3 } = require('@opentelemetry/winston-transport'); +const winston = require('winston'); + + +// To start a logger, you first need to initialize the Logger provider. +const loggerProvider = new LoggerProvider(); +// Add a processor to export log record +loggerProvider.addLogRecordProcessor( + new SimpleLogRecordProcessor(new ConsoleLogRecordExporter()) +); +logsAPI.logs.setGlobalLoggerProvider(loggerProvider); + +const logger = winston.createLogger({ + level: 'info', + transports: [ + new winston.transports.Console(), + new OpenTelemetryTransportV3() + ] +}); +``` + +### Supported versions + +Winston `3.x` + +## Useful links + +* For more information on OpenTelemetry, visit: +* For more about OpenTelemetry JavaScript: +* For help or feedback on this project, join us in [GitHub Discussions][discussions-url] + +## License + +Apache 2.0 - See [LICENSE][license-url] for more information. + +[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions +[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE +[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat +[npm-url]: https://www.npmjs.com/package/@opentelemetry/winston-transport +[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fwinston-transport.svg diff --git a/packages/winston-transport/package.json b/packages/winston-transport/package.json new file mode 100644 index 0000000000..2a9c16cd0f --- /dev/null +++ b/packages/winston-transport/package.json @@ -0,0 +1,57 @@ +{ + "name": "@opentelemetry/winston-transport", + "version": "0.1.0", + "description": "OpenTelemetry Transport for winston", + "main": "build/src/index.js", + "types": "build/src/index.d.ts", + "repository": "open-telemetry/opentelemetry-js-contrib", + "scripts": { + "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", + "tdd": "npm run test -- --watch-extensions ts --watch", + "clean": "rimraf build/*", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/winston-transport --include-dependencies", + "prewatch": "npm run precompile", + "prepublishOnly": "npm run compile", + "version:update": "node ../../scripts/version-update.js", + "compile": "tsc -p ." + }, + "keywords": [ + "transport", + "logging", + "nodejs", + "opentelemetry", + "winston" + ], + "author": "OpenTelemetry Authors", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + }, + "files": [ + "build/src/**/*.js", + "build/src/**/*.js.map", + "build/src/**/*.d.ts" + ], + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@types/mocha": "7.0.2", + "@types/node": "18.6.5", + "@types/sinon": "10.0.18", + "@types/triple-beam": "1.3.2", + "mocha": "7.2.0", + "nyc": "15.1.0", + "rimraf": "5.0.5", + "sinon": "15.2.0", + "ts-mocha": "10.0.0", + "typescript": "4.4.4" + }, + "dependencies": { + "@opentelemetry/api-logs": "^0.49.1", + "winston-transport" : "4.*" + }, + "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme" +} diff --git a/packages/winston-transport/src/OpenTelemetryTransportV3.ts b/packages/winston-transport/src/OpenTelemetryTransportV3.ts new file mode 100644 index 0000000000..9ff40c4929 --- /dev/null +++ b/packages/winston-transport/src/OpenTelemetryTransportV3.ts @@ -0,0 +1,43 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Logger, logs } from '@opentelemetry/api-logs'; +import * as Transport from 'winston-transport'; +import { VERSION } from './version'; +import { emitLogRecord } from './utils'; + +export class OpenTelemetryTransportV3 extends Transport { + private _logger: Logger; + + constructor(options?: Transport.TransportStreamOptions) { + super(options); + this._logger = logs.getLogger('@opentelemetry/winston-transport', VERSION); + } + + public override log(info: any, next: () => void) { + try { + emitLogRecord(info, this._logger); + } catch (error) { + this.emit('warn', error); + } + setImmediate(() => { + this.emit('logged', info); + }); + if (next) { + setImmediate(next); + } + } +} diff --git a/packages/winston-transport/src/index.ts b/packages/winston-transport/src/index.ts new file mode 100644 index 0000000000..414b1300de --- /dev/null +++ b/packages/winston-transport/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { OpenTelemetryTransportV3 } from './OpenTelemetryTransportV3'; diff --git a/packages/winston-transport/src/utils.ts b/packages/winston-transport/src/utils.ts new file mode 100644 index 0000000000..976d0f55da --- /dev/null +++ b/packages/winston-transport/src/utils.ts @@ -0,0 +1,80 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + LogAttributes, + LogRecord, + Logger, + SeverityNumber, +} from '@opentelemetry/api-logs'; + +const npmLevels: Record = { + error: SeverityNumber.ERROR, + warn: SeverityNumber.WARN, + info: SeverityNumber.INFO, + http: SeverityNumber.DEBUG3, + verbose: SeverityNumber.DEBUG2, + debug: SeverityNumber.DEBUG, + silly: SeverityNumber.TRACE, +}; + +const sysLoglevels: Record = { + emerg: SeverityNumber.FATAL3, + alert: SeverityNumber.FATAL2, + crit: SeverityNumber.FATAL, + error: SeverityNumber.ERROR, + warning: SeverityNumber.WARN, + notice: SeverityNumber.INFO2, + info: SeverityNumber.INFO, + debug: SeverityNumber.DEBUG, +}; + +const cliLevels: Record = { + error: SeverityNumber.ERROR, + warn: SeverityNumber.WARN, + help: SeverityNumber.INFO3, + data: SeverityNumber.INFO2, + info: SeverityNumber.INFO, + debug: SeverityNumber.DEBUG, + prompt: SeverityNumber.TRACE4, + verbose: SeverityNumber.TRACE3, + input: SeverityNumber.TRACE2, + silly: SeverityNumber.TRACE, +}; + +function getSeverityNumber(level: string): SeverityNumber | undefined { + return npmLevels[level] ?? sysLoglevels[level] ?? cliLevels[level]; +} + +export function emitLogRecord( + record: Record, + logger: Logger +): void { + const { message, level, ...splat } = record; + const attributes: LogAttributes = {}; + for (const key in splat) { + if (Object.prototype.hasOwnProperty.call(splat, key)) { + attributes[key] = splat[key]; + } + } + const logRecord: LogRecord = { + severityNumber: getSeverityNumber(level), + severityText: level, + body: message, + attributes: attributes, + }; + logger.emit(logRecord); +} diff --git a/packages/winston-transport/test/openTelemetryTransport.test.ts b/packages/winston-transport/test/openTelemetryTransport.test.ts new file mode 100644 index 0000000000..17516e5e51 --- /dev/null +++ b/packages/winston-transport/test/openTelemetryTransport.test.ts @@ -0,0 +1,146 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { SeverityNumber, logs } from '@opentelemetry/api-logs'; +import { + LoggerProvider, + SimpleLogRecordProcessor, + InMemoryLogRecordExporter, +} from '@opentelemetry/sdk-logs'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import { OpenTelemetryTransportV3 } from '../src'; + +const loggerProvider = new LoggerProvider(); +const memoryLogExporter = new InMemoryLogRecordExporter(); +loggerProvider.addLogRecordProcessor( + new SimpleLogRecordProcessor(memoryLogExporter) +); +logs.setGlobalLoggerProvider(loggerProvider); + +const kMessage = 'log-message'; + +describe('OpenTelemetryTransportV3', () => { + beforeEach(() => { + memoryLogExporter.getFinishedLogRecords().length = 0; // clear + }); + + it('emit LogRecord', () => { + const transport = new OpenTelemetryTransportV3(); + const writeSpy = sinon.spy(transport, 'emit'); + transport.log({ message: kMessage }, () => {}); + setImmediate(() => { + sinon.assert.calledOnce(writeSpy); + }); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(kMessage, logRecords[0].body, kMessage); + }); + + it('emit LogRecord with extra attibutes', () => { + const transport = new OpenTelemetryTransportV3(); + const extraAttributes = { + extraAttribute1: 'attributeValue1', + extraAttribute2: 'attributeValue2', + }; + const parameters = Object.assign({ message: kMessage }, extraAttributes); + transport.log(parameters, () => {}); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(logRecords[0].body, kMessage); + assert.strictEqual( + logRecords[0].attributes['extraAttribute1'], + 'attributeValue1' + ); + assert.strictEqual( + logRecords[0].attributes['extraAttribute2'], + 'attributeValue2' + ); + }); + + describe('emit logRecord severity', () => { + it('npm levels', () => { + const callback = () => {}; + const transport = new OpenTelemetryTransportV3(); + transport.log({ message: kMessage, level: 'error' }, callback); + transport.log({ message: kMessage, level: 'warn' }, callback); + transport.log({ message: kMessage, level: 'info' }, callback); + transport.log({ message: kMessage, level: 'http' }, callback); + transport.log({ message: kMessage, level: 'verbose' }, callback); + transport.log({ message: kMessage, level: 'debug' }, callback); + transport.log({ message: kMessage, level: 'silly' }, callback); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 7); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.ERROR); + assert.strictEqual(logRecords[1].severityNumber, SeverityNumber.WARN); + assert.strictEqual(logRecords[2].severityNumber, SeverityNumber.INFO); + assert.strictEqual(logRecords[3].severityNumber, SeverityNumber.DEBUG3); + assert.strictEqual(logRecords[4].severityNumber, SeverityNumber.DEBUG2); + assert.strictEqual(logRecords[5].severityNumber, SeverityNumber.DEBUG); + assert.strictEqual(logRecords[6].severityNumber, SeverityNumber.TRACE); + }); + + it('cli levels', () => { + const callback = () => {}; + const transport = new OpenTelemetryTransportV3(); + transport.log({ message: kMessage, level: 'error' }, callback); + transport.log({ message: kMessage, level: 'warn' }, callback); + transport.log({ message: kMessage, level: 'help' }, callback); + transport.log({ message: kMessage, level: 'data' }, callback); + transport.log({ message: kMessage, level: 'info' }, callback); + transport.log({ message: kMessage, level: 'debug' }, callback); + transport.log({ message: kMessage, level: 'verbose' }, callback); + transport.log({ message: kMessage, level: 'prompt' }, callback); + transport.log({ message: kMessage, level: 'input' }, callback); + transport.log({ message: kMessage, level: 'silly' }, callback); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 10); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.ERROR); + assert.strictEqual(logRecords[1].severityNumber, SeverityNumber.WARN); + assert.strictEqual(logRecords[2].severityNumber, SeverityNumber.INFO3); + assert.strictEqual(logRecords[3].severityNumber, SeverityNumber.INFO2); + assert.strictEqual(logRecords[4].severityNumber, SeverityNumber.INFO); + assert.strictEqual(logRecords[5].severityNumber, SeverityNumber.DEBUG); + assert.strictEqual(logRecords[6].severityNumber, SeverityNumber.DEBUG2); + assert.strictEqual(logRecords[7].severityNumber, SeverityNumber.TRACE4); + assert.strictEqual(logRecords[8].severityNumber, SeverityNumber.TRACE2); + assert.strictEqual(logRecords[9].severityNumber, SeverityNumber.TRACE); + }); + + it('syslog levels', () => { + const callback = () => {}; + const transport = new OpenTelemetryTransportV3(); + transport.log({ message: kMessage, level: 'emerg' }, callback); + transport.log({ message: kMessage, level: 'alert' }, callback); + transport.log({ message: kMessage, level: 'crit' }, callback); + transport.log({ message: kMessage, level: 'error' }, callback); + transport.log({ message: kMessage, level: 'warning' }, callback); + transport.log({ message: kMessage, level: 'notice' }, callback); + transport.log({ message: kMessage, level: 'info' }, callback); + transport.log({ message: kMessage, level: 'debug' }, callback); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 8); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.FATAL3); + assert.strictEqual(logRecords[1].severityNumber, SeverityNumber.FATAL2); + assert.strictEqual(logRecords[2].severityNumber, SeverityNumber.FATAL); + assert.strictEqual(logRecords[3].severityNumber, SeverityNumber.ERROR); + assert.strictEqual(logRecords[4].severityNumber, SeverityNumber.WARN); + assert.strictEqual(logRecords[5].severityNumber, SeverityNumber.INFO2); + assert.strictEqual(logRecords[6].severityNumber, SeverityNumber.INFO); + assert.strictEqual(logRecords[7].severityNumber, SeverityNumber.DEBUG); + }); + }); +}); diff --git a/packages/winston-transport/tsconfig.json b/packages/winston-transport/tsconfig.json new file mode 100644 index 0000000000..4078877ce6 --- /dev/null +++ b/packages/winston-transport/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/plugins/node/opentelemetry-instrumentation-winston/.tav.yml b/plugins/node/opentelemetry-instrumentation-winston/.tav.yml index 69b59a03fe..34335a07f7 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-winston/.tav.yml @@ -1,5 +1,5 @@ winston: - # a sample from supported versions - - versions: "3.3.3 || 3.2.1 || 2.4.5 || 2.4.4 || 2.1.1" + # A selection of versions of Winston 2.x and 3.x + - versions: "2.0.0 || 2.4.0 || 2.4.7 || 3.3.1 || 3.6.0 || 3.10.0 || ^3.11.0" commands: npm run test diff --git a/plugins/node/opentelemetry-instrumentation-winston/README.md b/plugins/node/opentelemetry-instrumentation-winston/README.md index 2ade7da7c2..d6bcbcca99 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/README.md +++ b/plugins/node/opentelemetry-instrumentation-winston/README.md @@ -3,7 +3,7 @@ [![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image] -This module provides automatic instrumentation for injection of trace context for the [`winston`](https://www.npmjs.com/package/winston) module, which may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle. +This module provides automatic instrumentation of the [`winston`](https://www.npmjs.com/package/winston) module to inject trace-context into Winston log records (log correlation) and to send Winston logging to the OpenTelemetry Logging SDK (log sending). It may be loaded using the [`@opentelemetry/sdk-trace-node`](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node) package and is included in the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle. If total installation size is not constrained, it is recommended to use the [`@opentelemetry/auto-instrumentations-node`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node) bundle with [@opentelemetry/sdk-node](`https://www.npmjs.com/package/@opentelemetry/sdk-node`) for the most seamless instrumentation experience. @@ -19,47 +19,92 @@ npm install --save @opentelemetry/instrumentation-winston ```js const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); +const logsAPI = require('@opentelemetry/api-logs'); +const { + LoggerProvider, + SimpleLogRecordProcessor, + ConsoleLogRecordExporter, +} = require('@opentelemetry/sdk-logs'); const { WinstonInstrumentation } = require('@opentelemetry/instrumentation-winston'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); -const provider = new NodeTracerProvider(); -provider.register(); +const tracerProvider = new NodeTracerProvider(); +tracerProvider.register(); + +// To start a logger, you first need to initialize the Logger provider. +const loggerProvider = new LoggerProvider(); +// Add a processor to export log record +loggerProvider.addLogRecordProcessor( + new SimpleLogRecordProcessor(new ConsoleLogRecordExporter()) +); +logsAPI.logs.setGlobalLoggerProvider(loggerProvider); registerInstrumentations({ - instrumentations: [ - new WinstonInstrumentation({ - // Optional hook to insert additional context to log metadata. - // Called after trace context is injected to metadata. - logHook: (span, record) => { - record['resource.service.name'] = provider.resource.attributes['service.name']; - }, - }), - // other instrumentations - ], + instrumentations: [ + new WinstonInstrumentation({ + // See below for Winston instrumentation options. + }), + ], }); const winston = require('winston'); const logger = winston.createLogger({ - transports: [new winston.transports.Console()], + transports: [new winston.transports.Console()], }) logger.info('foobar'); // {"message":"foobar","trace_id":"e21c7a95fff34e04f77c7bd518779621","span_id":"b7589a981fde09f4","trace_flags":"01", ...} ``` -### Fields added to Winston metadata +### Winston instrumentation options + +| Option | Type | Description | +| ----------------------- | ----------------- | ----------- | +| `disableLogSending` | `boolean` | Whether to disable [log sending](#log-sending). Default `false`. | +| `disableLogCorrelation` | `boolean` | Whether to disable [log correlation](#log-correlation). Default `false`. | +| `logHook` | `LogHookFunction` | An option hook to inject additional context to a log record after trace-context has been added. This requires `disableLogCorrelation` to be false. | + +### Log sending + +Winston Logger will automatically send log records to the OpenTelemetry Logs SDK if not explicitly disabled in config and @opentelemetry/winston-transport npm package is installed in the project. The OpenTelemetry SDK can be configured to handle those records, for example, sending them on to an OpenTelemetry collector for log archiving and processing. The example above shows a minimal configuration that emits OpenTelemetry log records to the console for debugging. + +If the OpenTelemetry SDK is not configured with a Logger provider, then this will be a no-op. + +Log sending can be disabled with the `disableLogSending: true` option. Log sending is only available for Winston version 3 and later. + +```bash +npm install --save @opentelemetry/winston-transport +``` + +### Log correlation -For the current active span, the following fields are injected: +Winston logger calls in the context of a tracing span will have fields +indentifying the span added to the log record. This allows +[correlating](https://opentelemetry.io/docs/specs/otel/logs/#log-correlation) +log records with tracing data. The added fields are +([spec](https://opentelemetry.io/docs/specs/otel/compatibility/logging_trace_context/)): * `trace_id` * `span_id` * `trace_flags` -When no span context is active or the span context is invalid, injection is skipped. +After adding these fields, the optional `logHook` is called to allow injecting additional fields. For example: + +```js +logHook: (span, record) => { + record['resource.service.name'] = provider.resource.attributes['service.name']; +} +``` + +Log injection can be disabled with the `disableLogCorrelation: true` option. ### Supported versions `1.x`, `2.x`, `3.x` +Log sending + +`3.x` + ## Useful links * For more information on OpenTelemetry, visit: diff --git a/plugins/node/opentelemetry-instrumentation-winston/package.json b/plugins/node/opentelemetry-instrumentation-winston/package.json index d2850d38cb..bdec39fcfd 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/package.json +++ b/plugins/node/opentelemetry-instrumentation-winston/package.json @@ -45,9 +45,10 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/sdk-trace-base": "^1.8.0", - "@opentelemetry/sdk-trace-node": "^1.8.0", + "@opentelemetry/context-async-hooks": "^1.21.0", + "@opentelemetry/sdk-trace-base": "^1.21.0", + "@opentelemetry/sdk-trace-node": "^1.21.0", + "@opentelemetry/winston-transport": "^0.1.0", "@types/mocha": "7.0.2", "@types/node": "18.6.5", "@types/sinon": "10.0.18", diff --git a/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts index 6b4c8dbaa8..d89107144c 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts @@ -14,13 +14,7 @@ * limitations under the License. */ -import { - context, - trace, - isSpanContextValid, - Span, - SpanContext, -} from '@opentelemetry/api'; +import { context, trace, isSpanContextValid, Span } from '@opentelemetry/api'; import { InstrumentationBase, InstrumentationNodeModuleDefinition, @@ -32,6 +26,7 @@ import type { WinstonInstrumentationConfig } from './types'; import type { Winston2LogMethod, Winston2LoggerModule, + Winston3ConfigureMethod, Winston3LogMethod, Winston3Logger, } from './internal-types'; @@ -46,7 +41,7 @@ export class WinstonInstrumentation extends InstrumentationBase { } protected init() { - return [ + const winstons3instrumentationNodeModuleDefinition = new InstrumentationNodeModuleDefinition<{}>( 'winston', winston3Versions, @@ -61,18 +56,31 @@ export class WinstonInstrumentation extends InstrumentationBase { if (isWrapped(logger.prototype['write'])) { this._unwrap(logger.prototype, 'write'); } - this._wrap(logger.prototype, 'write', this._getPatchedWrite()); + + // Wrap configure + if (isWrapped(logger.prototype['configure'])) { + this._unwrap(logger.prototype, 'configure'); + } + this._wrap( + logger.prototype, + 'configure', + this._getPatchedConfigure() + ); + return logger; }, (logger, moduleVersion) => { if (logger === undefined) return; this._diag.debug(`Removing patch for winston@${moduleVersion}`); this._unwrap(logger.prototype, 'write'); + this._unwrap(logger.prototype, 'configure'); } ), ] - ), + ); + + const winstons2instrumentationNodeModuleDefinition = new InstrumentationNodeModuleDefinition<{}>( 'winston', winstonPre3Versions, @@ -89,7 +97,6 @@ export class WinstonInstrumentation extends InstrumentationBase { if (isWrapped(proto.log)) { this._unwrap(proto, 'log'); } - this._wrap(proto, 'log', this._getPatchedLog()); return fileExports; @@ -101,7 +108,10 @@ export class WinstonInstrumentation extends InstrumentationBase { } ), ] - ), + ); + return [ + winstons3instrumentationNodeModuleDefinition, + winstons2instrumentationNodeModuleDefinition, ]; } @@ -138,22 +148,8 @@ export class WinstonInstrumentation extends InstrumentationBase { this: never, ...args: Parameters ) { - const span = trace.getSpan(context.active()); - - if (!span) { - return original.apply(this, args); - } - - const spanContext = span.spanContext(); - - if (!isSpanContextValid(spanContext)) { - return original.apply(this, args); - } - const record = args[0]; - injectRecord(spanContext, record); - instrumentation._callHook(span, record); - + instrumentation._handleLogCorrelation(record); return original.apply(this, args); }; }; @@ -163,59 +159,89 @@ export class WinstonInstrumentation extends InstrumentationBase { return (original: Winston2LogMethod) => { const instrumentation = this; return function patchedLog( - this: unknown, + this: never, ...args: Parameters ) { - const span = trace.getSpan(context.active()); - - if (!span) { - return original.apply(this, args); - } - - const spanContext = span.spanContext(); - - if (!isSpanContextValid(spanContext)) { - return original.apply(this, args); - } - + const record: Record = {}; + instrumentation._handleLogCorrelation(record); + // Inject in metadata argument + let isDataInjected = false; for (let i = args.length - 1; i >= 0; i--) { if (typeof args[i] === 'object') { - const record = args[i]; - injectRecord(spanContext, record); - instrumentation._callHook(span, record); - return original.apply(this, args); + args[i] = Object.assign(args[i], record); + isDataInjected = true; + break; } } + if (!isDataInjected) { + const insertAt = + typeof args[args.length - 1] === 'function' + ? args.length - 1 + : args.length; - const record = injectRecord(spanContext); - - const insertAt = - typeof args[args.length - 1] === 'function' - ? args.length - 1 - : args.length; - - args.splice(insertAt, 0, record); - instrumentation._callHook(span, record); + args.splice(insertAt, 0, record); + } return original.apply(this, args); }; }; } -} -function injectRecord( - spanContext: SpanContext, - record?: Record -) { - const fields = { - trace_id: spanContext.traceId, - span_id: spanContext.spanId, - trace_flags: `0${spanContext.traceFlags.toString(16)}`, - }; - - if (!record) { - return fields; + private _getPatchedConfigure() { + return (original: Winston3ConfigureMethod) => { + const instrumentation = this; + return function patchedConfigure( + this: never, + ...args: Parameters + ) { + const config = instrumentation.getConfig(); + if (!config.disableLogSending) { + if (args && args.length > 0) { + // Try to load Winston transport + try { + const { + OpenTelemetryTransportV3, + } = require('@opentelemetry/winston-transport'); + const originalTransports = args[0].transports; + let newTransports = Array.isArray(originalTransports) + ? originalTransports + : []; + const openTelemetryTransport = new OpenTelemetryTransportV3(); + if (originalTransports && !Array.isArray(originalTransports)) { + newTransports = [originalTransports]; + } + newTransports.push(openTelemetryTransport); + args[0].transports = newTransports; + } catch (err) { + instrumentation._diag.warn( + 'OpenTelemetry Winston transport is not available, log records will not be automatically sent.', + err + ); + } + } + } + return original.apply(this, args); + }; + }; } - return Object.assign(record, fields); + private _handleLogCorrelation(record: Record) { + if (!this.getConfig().disableLogCorrelation) { + const span = trace.getSpan(context.active()); + if (span) { + const spanContext = span.spanContext(); + if (isSpanContextValid(spanContext)) { + const fields = { + trace_id: spanContext.traceId, + span_id: spanContext.spanId, + trace_flags: `0${spanContext.traceFlags.toString(16)}`, + }; + const enhancedRecord = Object.assign(record, fields); + this._callHook(span, enhancedRecord); + return enhancedRecord; + } + } + } + return record; + } } diff --git a/plugins/node/opentelemetry-instrumentation-winston/src/internal-types.ts b/plugins/node/opentelemetry-instrumentation-winston/src/internal-types.ts index 0138a85266..cba7ee90d2 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/src/internal-types.ts +++ b/plugins/node/opentelemetry-instrumentation-winston/src/internal-types.ts @@ -20,10 +20,13 @@ import type { LogMethod as Winston2LogMethod, } from 'winston2'; export type Winston3LogMethod = Winston3Logger['write']; +export type Winston3ConfigureMethod = Winston3Logger['configure']; export type { Winston3Logger }; export type { Winston2LogMethod }; export type Winston2LoggerModule = { - Logger: Winston2Logger & { prototype: { log: Winston2LogMethod } }; + Logger: Winston2Logger & { + prototype: { log: Winston2LogMethod }; + }; }; export type { Winston2Logger }; diff --git a/plugins/node/opentelemetry-instrumentation-winston/src/types.ts b/plugins/node/opentelemetry-instrumentation-winston/src/types.ts index d3fa20eb12..5621bc8797 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/src/types.ts +++ b/plugins/node/opentelemetry-instrumentation-winston/src/types.ts @@ -21,5 +21,24 @@ import { InstrumentationConfig } from '@opentelemetry/instrumentation'; export type LogHookFunction = (span: Span, record: Record) => void; export interface WinstonInstrumentationConfig extends InstrumentationConfig { + /** + * Whether to disable the automatic sending of log records to the + * OpenTelemetry Logs SDK. + * @default false + */ + disableLogSending?: boolean; + + /** + * Whether to disable the injection trace-context fields, and possibly other + * fields from `logHook()`, into log records for log correlation. + * @default false + */ + disableLogCorrelation?: boolean; + + /** + * A function that allows injecting additional fields in log records. It is + * called, as `logHook(span, record)`, for each log record emitted in a valid + * span context. It requires `disableLogCorrelation` to be false. + */ logHook?: LogHookFunction; } diff --git a/plugins/node/opentelemetry-instrumentation-winston/test/winston.test.ts b/plugins/node/opentelemetry-instrumentation-winston/test/winston.test.ts index bdc8ff8d80..fe62a946b9 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/test/winston.test.ts +++ b/plugins/node/opentelemetry-instrumentation-winston/test/winston.test.ts @@ -14,6 +14,12 @@ * limitations under the License. */ +import { SeverityNumber, logs } from '@opentelemetry/api-logs'; +import { + LoggerProvider, + SimpleLogRecordProcessor, + InMemoryLogRecordExporter, +} from '@opentelemetry/sdk-logs'; import { InMemorySpanExporter, SimpleSpanProcessor, @@ -34,15 +40,37 @@ const tracer = provider.getTracer('default'); provider.addSpanProcessor(new SimpleSpanProcessor(memoryExporter)); context.setGlobalContextManager(new AsyncHooksContextManager()); +const loggerProvider = new LoggerProvider(); +const memoryLogExporter = new InMemoryLogRecordExporter(); +loggerProvider.addLogRecordProcessor( + new SimpleLogRecordProcessor(memoryLogExporter) +); +logs.setGlobalLoggerProvider(loggerProvider); + const kMessage = 'log-message'; describe('WinstonInstrumentation', () => { let logger: Winston3Logger | Winston2Logger; let writeSpy: sinon.SinonSpy; let instrumentation: WinstonInstrumentation; + let isWinston2 = false; - function initLogger() { + enum LevelsType { + npm, + syslog, + cli, + } + + function initLogger(levelsType?: LevelsType) { const winston = require('winston'); + + let levels = winston.config.npm.levels; + if (levelsType === LevelsType.syslog) { + levels = winston.config.syslog.levels; + } else if (levelsType === LevelsType.cli) { + levels = winston.config.cli.levels; + } + const stream = new Writable(); stream._write = () => {}; writeSpy = sinon.spy(stream, 'write'); @@ -50,6 +78,8 @@ describe('WinstonInstrumentation', () => { if (winston['createLogger']) { // winston 3.x logger = winston.createLogger({ + level: 'debug', + levels: levels, transports: [ new winston.transports.Stream({ stream, @@ -58,7 +88,9 @@ describe('WinstonInstrumentation', () => { }); } else if (winston['Logger']) { // winston 2.x + isWinston2 = true; logger = new winston.Logger({ + levels: levels, transports: [ new winston.transports.File({ stream, @@ -91,13 +123,41 @@ describe('WinstonInstrumentation', () => { return record; } + function testEmitLogRecord(span: Span) { + logger.info(kMessage); + sinon.assert.calledOnce(writeSpy); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + const { traceId, spanId, traceFlags } = span.spanContext(); + assert.strictEqual(logRecords[0]['attributes']['trace_id'], traceId); + assert.strictEqual(logRecords[0]['attributes']['span_id'], spanId); + assert.strictEqual( + logRecords[0]['attributes']['trace_flags'], + `0${traceFlags.toString(16)}` + ); + assert.strictEqual(kMessage, logRecords[0].body, kMessage); + return logRecords; + } + + function testNoEmitLogRecord() { + logger.info(kMessage); + sinon.assert.calledOnce(writeSpy); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 0); + return logRecords; + } + before(() => { instrumentation = new WinstonInstrumentation(); instrumentation.enable(); }); describe('enabled instrumentation', () => { - beforeEach(initLogger); + beforeEach(() => { + initLogger(); + instrumentation.setConfig({}); // reset to defaults + memoryLogExporter.getFinishedLogRecords().length = 0; // clear + }); it('wraps write', () => { if ('write' in logger) { @@ -110,6 +170,13 @@ describe('WinstonInstrumentation', () => { } }); + it('wraps configure', () => { + if (!isWinston2) { + // winston 3.x + assert.ok(isWrapped(logger['configure'])); + } + }); + it('injects span context to records', () => { const span = tracer.startSpan('abc'); context.with(trace.setSpan(context.active(), span), () => { @@ -131,11 +198,89 @@ describe('WinstonInstrumentation', () => { }); }); + it('emit LogRecord', () => { + if (!isWinston2) { + instrumentation.setConfig({ + disableLogSending: false, + }); + initLogger(); + const span = tracer.startSpan('abc'); + context.with(trace.setSpan(context.active(), span), () => { + testEmitLogRecord(span); + }); + } + }); + + it('emit LogRecord with extra attibutes', () => { + if (!isWinston2) { + instrumentation.setConfig({ + disableLogSending: false, + }); + const extraAttributes = { + extraAttribute1: 'attributeValue1', + extraAttribute2: 'attributeValue2', + }; + logger.log('info', kMessage, extraAttributes); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(logRecords[0].severityText, 'info'); + assert.strictEqual(logRecords[0].body, kMessage); + assert.strictEqual( + logRecords[0].attributes['extraAttribute1'], + 'attributeValue1' + ); + assert.strictEqual( + logRecords[0].attributes['extraAttribute2'], + 'attributeValue2' + ); + } + }); + + it('do not emit log record if @opentelemetry/winston-transport load fails', () => { + const module = require('module'); + const originalRequire = module.prototype.require; + module.prototype.require = function () { + if (arguments[0] === '@opentelemetry/winston-transport') { + throw new Error('@opentelemetry/winston-transport not present'); + } + return originalRequire.apply(this, arguments); + }; + + instrumentation.setConfig({ + disableLogSending: false, + }); + initLogger(); + module.prototype.require = originalRequire; + testNoEmitLogRecord(); + }); + + it('does not emit LogRecord if config off', () => { + instrumentation.setConfig({ + disableLogSending: true, + }); + initLogger(); + const span = tracer.startSpan('abc'); + context.with(trace.setSpan(context.active(), span), () => { + testNoEmitLogRecord(); + }); + }); + it('does not inject span context if no span is active', () => { assert.strictEqual(trace.getSpan(context.active()), undefined); testNoInjection(); }); + it('does not inject span context if config off', () => { + instrumentation.setConfig({ + enabled: true, + disableLogCorrelation: true, + }); + const span = tracer.startSpan('abc'); + context.with(trace.setSpan(context.active(), span), () => { + testNoInjection(); + }); + }); + it('does not inject span context if span context is invalid', () => { const span = trace.wrapSpanContext(INVALID_SPAN_CONTEXT); context.with(trace.setSpan(context.active(), span), () => { @@ -166,7 +311,10 @@ describe('WinstonInstrumentation', () => { instrumentation.enable(); }); - beforeEach(initLogger); + beforeEach(() => { + initLogger(); + memoryLogExporter.getFinishedLogRecords().length = 0; // clear + }); it('does not inject span context', () => { const span = tracer.startSpan('abc'); @@ -188,5 +336,51 @@ describe('WinstonInstrumentation', () => { assert.strictEqual(record['resource.service.name'], undefined); }); }); + + it('does not emit logRecord', () => { + testNoEmitLogRecord(); + }); + }); + + describe('emit logRecord severity', () => { + beforeEach(() => { + instrumentation.setConfig({ + disableLogSending: false, + }); + memoryLogExporter.getFinishedLogRecords().length = 0; // clear + }); + + it('npm levels', () => { + if (!isWinston2) { + initLogger(); + logger.log('http', kMessage); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(logRecords[0].severityText, 'http'); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.DEBUG3); + } + }); + + it('cli levels', () => { + if (!isWinston2) { + initLogger(LevelsType.cli); + logger.log('data', kMessage); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(logRecords[0].severityText, 'data'); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.INFO2); + } + }); + + it('syslog levels', () => { + if (!isWinston2) { + initLogger(LevelsType.syslog); + logger.log('emerg', kMessage); + const logRecords = memoryLogExporter.getFinishedLogRecords(); + assert.strictEqual(logRecords.length, 1); + assert.strictEqual(logRecords[0].severityText, 'emerg'); + assert.strictEqual(logRecords[0].severityNumber, SeverityNumber.FATAL3); + } + }); }); }); diff --git a/release-please-config.json b/release-please-config.json index 1beca3271e..6db17aa16a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -21,6 +21,7 @@ "packages/opentelemetry-redis-common": {}, "packages/opentelemetry-sql-common": {}, "packages/opentelemetry-test-utils": {}, + "packages/winston-transport": {}, "plugins/node/instrumentation-amqplib": {}, "plugins/node/instrumentation-cucumber": {}, "plugins/node/instrumentation-dataloader": {}, @@ -66,4 +67,4 @@ "propagators/opentelemetry-propagator-instana": {}, "propagators/opentelemetry-propagator-ot-trace": {} } -} +} \ No newline at end of file