From d39595ace649231745228be715ab677e83a0b046 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Sun, 13 Nov 2022 22:03:30 +0200 Subject: [PATCH 01/91] docs: add instrumentation dependencies guidelines (#1261) --- GUIDELINES.md | 93 +++++++++++++++++++ .../src/instrumentation.ts | 10 +- .../test/instrumentation.test.ts | 10 +- 3 files changed, 105 insertions(+), 8 deletions(-) diff --git a/GUIDELINES.md b/GUIDELINES.md index 42e4478421..42a1c4900b 100644 --- a/GUIDELINES.md +++ b/GUIDELINES.md @@ -39,3 +39,96 @@ This file MUST NOT be exported publicly from instrumentation package, not direct #### Changes Since the declarations in this file are not exported in the public instrumentation api, it is allowed to apply any refactors to this file, and they will not be breaking changes to users. + +## Dependencies + +This section refers to the "dependencies" and "peerDependencies" entries in instrumentation's `package.json` file. + +Since instrumentations will install all their dependencies into the end user `node_modules` application, they should be examined to guarantee only small-size-required packages are added. + +### OpenTelemetry API + +Instrumentation SHOULD NOT add a dependency on `@opentelemetry/api`, as using multiple instrumentations might install multiple api versions into the user node_modules directory. It SHOULD add an entry in `"peerDependencies"` in `package.json` with the **minimum** api version it requires, as caret range (for example: `^1.0.0`). + +Users and distributions need to install a version of `@opentelemetry/api` that is compatible with the instrumentation to use it. + +### OpenTelemetry Core packages + +Most instrumentations will depend on `@opentelemetry/instrumentation` and `@opentelemetry/semantic-conventions`. If needed, instrumentations can also depend on `@opentelemetry/core` for use of handy utils. + +Instrumentations SHOULD specify these dependencies as caret range (`^1.0.0`), with minimum supported version (and not latest version). If a specific feature or bug fix is required for instrumentation to function correctly, it SHOULD specify the minimum version that includes this feature. + +### Instrumented Package Dependency + +Instrumentations SHOULD NOT add a `"dependency"` or `"peerDependencies"` on the package it is instrumenting as it can end up installing this package into users' applications, adding large overhead. + +This means that the instrumentation code SHOULD NOT `import` anywhere from the instrumented package. e.g. `@opentelemetry/instrumentation-foo` cannot `import 'foo'` as it will fail for applications that installed the instrumentation but not the `foo` package itself, which is a valid and supported use case for OpenTelemetry distributions and end users. + +It is allowed, however, to import `types` from the instrumented package with the [`import type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) syntax, as long as this type is not used in the public api: + +```js +// instrumentation.ts +import type { Bar } from 'foo'; // OK +``` + +Since the instrumented package is installed as a dev dependency, types are available during compiling. Since they are not part of the public api, typescript removes these imports from the build artifacts during transpilation. + +### Types Public API + +When users install an instrumentation package into their typescript application, and `import * from '@opentelemetry/instrumentation-foo'` in their code, typescript compiler will look for the instrumentation package ["types"](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package) file `index.d.ts` and use it. If this file reference other type files such as `export * from './instrumentation';`, typescript will then import and transpile these files (and other transitive files they might use) as well. We will call these files "public" as they are exposed to the package consumers and processed by their typescript compiler when transpiling their applications. + +If one of these files `import`s from a package that is not in users' `node_module` directory, the instrumentation package will fail transpilation for the end users' application which should be avoided. A common problem is "leaking" the types from the instrumented package (which we cannot assume to be found in end-user `node_module`) in one of these public modules ".d.ts" files. + +When invoking `npm run compile` on the instrumentation package, typescript will generate the `.d.ts` types files in the `build` directory and will only include in them "public" types - those that can be consumed by the user of the module. These may include: + +- Types that are `export`ed from the module, or types that are transitively used in other types that are `export`ed from the module. +- Types in `public` functions of exported classes such as `class InstrumentationFoo`. +- Types used as [`Generic Type Varibles`] on exported generic types/classes/functions. + +Note that types that are used in non-public files (like `internal-types.ts` or `utils.ts`), or that are not somehow `export`ed from a module (for example - used in private function implementations), can safely use types from a "devDependency" package. + +### Adding Types in Public API + +Sometimes, instrumented package types are needed in an instrumentation's public api. These are mostly found in `types.ts` file on instrumentation config hooks that include data from the package and want to type it for consumers. + +To support this use case, you can choose one of the following options: + +1. Some packages do not distribute types. The types are alternatively available in the [Definitely Typed Project](https://github.com/DefinitelyTyped/DefinitelyTyped) as `@types/foo` (for a package named `foo`). Since @type package is mostly small in size, instrumentation MAY add dependency on the types package, and then use type-only import `import type from 'foo'` in `types.ts`. + + ```js + // package.json + { + ... + "dependencies": { + "@types/foo": "1.2.3" + }, + ... + } + + // types.ts + import type { Bar } from 'foo'; + + export interface FooRequestInfo { + bar: Bar; + } + + ... + ``` + + If possible, this is the prefered option, as it uses types from a maintained package. + + Notice that types may introduce breaking changes in major semver releases, and instrumentation should choose a `@types/` package that is compatible with the version range it supports. + +2. Copy the relevant type declarations into the instrumentation. You may choose to copy only a subset of the type that is relevant to the need. + + A type can transitively reference other types which in turn need to be copied as well. + + This option requires maintaining the types in the instrumentation codebase, which is not ideal. On the other end, it offers instrumentation users typing on its public API which is convenient. + + It is recommended to use this option when the types involved are simple and short. + +3. Use `any` type, and add a comment to guide users on what type they should expect, with a link to its definition. + + This option will offer no typing aid to the instrumentation consumer, which will move the burden and risk of checking type correctness to the user. + + It is recommended to implement it only if the previous options are not feasible or are too complex to use. diff --git a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts index 94b4feb035..d3ac0a74a7 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts @@ -27,10 +27,12 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; -import type { HookHandlerDoneFunction } from 'fastify/types/hooks'; -import type { FastifyInstance } from 'fastify/types/instance'; -import type { FastifyReply } from 'fastify/types/reply'; -import type { FastifyRequest } from 'fastify/types/request'; +import type { + HookHandlerDoneFunction, + FastifyInstance, + FastifyRequest, + FastifyReply, +} from 'fastify'; import { applicationHookNames } from './constants'; import { AttributeNames, diff --git a/plugins/node/opentelemetry-instrumentation-fastify/test/instrumentation.test.ts b/plugins/node/opentelemetry-instrumentation-fastify/test/instrumentation.test.ts index d80595728a..15570129b7 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/test/instrumentation.test.ts +++ b/plugins/node/opentelemetry-instrumentation-fastify/test/instrumentation.test.ts @@ -25,9 +25,6 @@ import { SimpleSpanProcessor, } from '@opentelemetry/sdk-trace-base'; import { Span } from '@opentelemetry/api'; -import { HookHandlerDoneFunction } from 'fastify/types/hooks'; -import { FastifyReply } from 'fastify/types/reply'; -import { FastifyRequest } from 'fastify/types/request'; import * as http from 'http'; import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; import { ANONYMOUS_NAME } from '../src/instrumentation'; @@ -70,7 +67,12 @@ instrumentation.enable(); httpInstrumentation.enable(); import '@fastify/express'; -import { FastifyInstance } from 'fastify/types/instance'; +import { + FastifyInstance, + HookHandlerDoneFunction, + FastifyReply, + FastifyRequest, +} from 'fastify'; const Fastify = require('fastify'); From e9fe8e13e34f54e96c50525cadeb74ac048c5624 Mon Sep 17 00:00:00 2001 From: Marc Hassan Date: Tue, 15 Nov 2022 15:57:01 -0500 Subject: [PATCH 02/91] feat: update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: update experimental deps to ^0.34.0 excludes `@opentelemetry/instrumentation-aws-lambda`, which is not yet compatible with `@opentelemetry/instrumentation@^0.34.0` * fix: pass `resourceDetectors` * feat: update api peer deps to `^1.3.0`, core deps to `^1.8.0` Co-authored-by: Gerhard Stöbich --- .../package.json | 20 +++++++++---------- .../README.md | 5 ++--- .../package.json | 6 +++--- ...nstanaAgentDetectorIntegrationTest.test.ts | 5 ++--- .../auto-instrumentations-node/package.json | 10 +++++----- .../auto-instrumentations-web/package.json | 10 +++++----- .../opentelemetry-test-utils/package.json | 12 +++++------ .../node/instrumentation-amqplib/package.json | 8 ++++---- .../instrumentation-dataloader/package.json | 12 +++++------ plugins/node/instrumentation-fs/package.json | 16 +++++++-------- .../instrumentation-lru-memoizer/package.json | 6 +++--- .../instrumentation-mongoose/package.json | 10 +++++----- .../node/instrumentation-tedious/package.json | 10 +++++----- .../package.json | 12 +++++------ .../package.json | 10 +++++----- .../package.json | 12 +++++------ .../package.json | 12 +++++------ .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 14 ++++++------- .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 8 ++++---- .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 12 +++++------ .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 12 +++++------ .../package.json | 10 +++++----- .../package.json | 10 +++++----- .../package.json | 12 +++++------ .../package.json | 10 +++++----- .../package.json | 12 +++++------ .../package.json | 12 +++++------ .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 14 ++++++------- .../package.json | 12 +++++------ .../package.json | 12 +++++------ .../package.json | 10 +++++----- .../package.json | 12 +++++------ .../package.json | 16 +++++++-------- 43 files changed, 246 insertions(+), 248 deletions(-) diff --git a/archive/opentelemetry-browser-extension-autoinjection/package.json b/archive/opentelemetry-browser-extension-autoinjection/package.json index 6338edc72b..613cb2e2de 100644 --- a/archive/opentelemetry-browser-extension-autoinjection/package.json +++ b/archive/opentelemetry-browser-extension-autoinjection/package.json @@ -26,10 +26,10 @@ "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/chrome": "0.0.154", "@types/jsdom": "16.2.13", "@types/mocha": "8.2.3", @@ -67,16 +67,16 @@ "@material-ui/icons": "4.11.2", "@material-ui/lab": "4.0.0-alpha.60", "@opentelemetry/context-zone": "^1.0.0", - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/exporter-trace-otlp-http": "^0.29.2", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/exporter-trace-otlp-http": "^0.34.0", "@opentelemetry/exporter-zipkin": "^1.0.0", - "@opentelemetry/instrumentation": "^0.29.2", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/instrumentation-document-load": "^0.29.0", - "@opentelemetry/instrumentation-fetch": "^0.29.2", - "@opentelemetry/instrumentation-xml-http-request": "^0.29.2", - "@opentelemetry/resources": "^1.0.0", - "@opentelemetry/sdk-trace-base": "^1.0.0", - "@opentelemetry/sdk-trace-web": "^1.0.0", + "@opentelemetry/instrumentation-fetch": "^0.34.0", + "@opentelemetry/instrumentation-xml-http-request": "^0.34.0", + "@opentelemetry/resources": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-web": "^1.8.0", "@opentelemetry/semantic-conventions": "^1.0.0", "change-case": "4.1.2", "json5": "2.2.0", diff --git a/detectors/node/opentelemetry-resource-detector-instana/README.md b/detectors/node/opentelemetry-resource-detector-instana/README.md index 427f00a259..531bf044f2 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/README.md +++ b/detectors/node/opentelemetry-resource-detector-instana/README.md @@ -36,13 +36,12 @@ const globalResource = new Resource({ const sdk = new NodeSDK({ autoDetectResources: false, + resourceDetectors: [envDetector, processDetector, instanaAgentDetector], resource: globalResource, }); (async () => { - await sdk.detectResources({ - detectors: [envDetector, processDetector, instanaAgentDetector], - }); + await sdk.detectResources(); await sdk.start(); }()); diff --git a/detectors/node/opentelemetry-resource-detector-instana/package.json b/detectors/node/opentelemetry-resource-detector-instana/package.json index f9d0a4973e..4c1266cffc 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/package.json +++ b/detectors/node/opentelemetry-resource-detector-instana/package.json @@ -39,9 +39,9 @@ "access": "public" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-node": "^0.32.0", + "@opentelemetry/sdk-node": "^0.34.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -58,7 +58,7 @@ "@opentelemetry/semantic-conventions": "^1.0.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-instana#readme" } diff --git a/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts b/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts index 92ee31bf55..99f4deb336 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts +++ b/detectors/node/opentelemetry-resource-detector-instana/test/InstanaAgentDetectorIntegrationTest.test.ts @@ -54,13 +54,12 @@ describe('[Integration] instanaAgentDetector', () => { const sdk = new NodeSDK({ autoDetectResources: false, + resourceDetectors: [envDetector, processDetector, instanaAgentDetector], resource: globalResource, }); // attributes are automatically merged! - await sdk.detectResources({ - detectors: [envDetector, processDetector, instanaAgentDetector], - }); + await sdk.detectResources(); const resource = sdk['_resource']; diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index 625f4c0397..abc61819b9 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -30,10 +30,10 @@ "url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -46,7 +46,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/instrumentation-amqplib": "^0.31.0", "@opentelemetry/instrumentation-aws-lambda": "^0.33.1", "@opentelemetry/instrumentation-aws-sdk": "^0.9.3", @@ -60,9 +60,9 @@ "@opentelemetry/instrumentation-fastify": "^0.30.1", "@opentelemetry/instrumentation-generic-pool": "^0.30.0", "@opentelemetry/instrumentation-graphql": "^0.32.0", - "@opentelemetry/instrumentation-grpc": "^0.32.0", + "@opentelemetry/instrumentation-grpc": "^0.34.0", "@opentelemetry/instrumentation-hapi": "^0.30.1", - "@opentelemetry/instrumentation-http": "^0.32.0", + "@opentelemetry/instrumentation-http": "^0.34.0", "@opentelemetry/instrumentation-ioredis": "^0.32.2", "@opentelemetry/instrumentation-knex": "^0.30.1", "@opentelemetry/instrumentation-koa": "^0.33.0", diff --git a/metapackages/auto-instrumentations-web/package.json b/metapackages/auto-instrumentations-web/package.json index a096d7a444..147829f4e0 100644 --- a/metapackages/auto-instrumentations-web/package.json +++ b/metapackages/auto-instrumentations-web/package.json @@ -30,11 +30,11 @@ "url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -60,10 +60,10 @@ "webpack-merge": "5.8.0" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/instrumentation-document-load": "^0.30.1", - "@opentelemetry/instrumentation-fetch": "^0.32.0", + "@opentelemetry/instrumentation-fetch": "^0.34.0", "@opentelemetry/instrumentation-user-interaction": "^0.31.1", - "@opentelemetry/instrumentation-xml-http-request": "^0.32.0" + "@opentelemetry/instrumentation-xml-http-request": "^0.34.0" } } diff --git a/packages/opentelemetry-test-utils/package.json b/packages/opentelemetry-test-utils/package.json index 1b41eea269..bf26eed8c5 100644 --- a/packages/opentelemetry-test-utils/package.json +++ b/packages/opentelemetry-test-utils/package.json @@ -38,10 +38,10 @@ }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/opentelemetry-test-utils#readme", "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/node": "18.11.7", "gts": "3.1.0", "typescript": "4.3.5" @@ -49,10 +49,10 @@ "dependencies": { "@opentelemetry/core": "^1.0.0", "@opentelemetry/exporter-jaeger": "^1.3.1", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/sdk-trace-node": "^1.3.1", - "@opentelemetry/resources": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", + "@opentelemetry/resources": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/semantic-conventions": "^1.0.0" } } diff --git a/plugins/node/instrumentation-amqplib/package.json b/plugins/node/instrumentation-amqplib/package.json index 8e7d661da9..789bee40d7 100644 --- a/plugins/node/instrumentation-amqplib/package.json +++ b/plugins/node/instrumentation-amqplib/package.json @@ -43,16 +43,16 @@ "test:docker:run": "docker run -d --hostname demo-amqplib-rabbit --name amqplib-unittests -p 22221:5672 --env RABBITMQ_DEFAULT_USER=username --env RABBITMQ_DEFAULT_PASS=password rabbitmq:3" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/amqplib": "^0.5.17" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", "@types/lodash": "4.14.178", "@types/mocha": "8.2.3", diff --git a/plugins/node/instrumentation-dataloader/package.json b/plugins/node/instrumentation-dataloader/package.json index 39f7ae002a..e714952935 100644 --- a/plugins/node/instrumentation-dataloader/package.json +++ b/plugins/node/instrumentation-dataloader/package.json @@ -43,13 +43,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.6.0", - "@opentelemetry/sdk-trace-base": "^1.6.0", - "@opentelemetry/sdk-trace-node": "^1.6.0", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "dataloader": "2.0.0", @@ -62,7 +62,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0" + "@opentelemetry/instrumentation": "^0.34.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-dataloader#readme" } diff --git a/plugins/node/instrumentation-fs/package.json b/plugins/node/instrumentation-fs/package.json index e22dbbc439..c5655d57ad 100644 --- a/plugins/node/instrumentation-fs/package.json +++ b/plugins/node/instrumentation-fs/package.json @@ -39,14 +39,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/resources": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", + "@opentelemetry/resources": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "^10.0.11", @@ -59,8 +59,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-fs#readme" diff --git a/plugins/node/instrumentation-lru-memoizer/package.json b/plugins/node/instrumentation-lru-memoizer/package.json index 4264d5a57a..6c309b6995 100644 --- a/plugins/node/instrumentation-lru-memoizer/package.json +++ b/plugins/node/instrumentation-lru-memoizer/package.json @@ -39,10 +39,10 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", "@types/lru-cache": "7.10.9", "@types/mocha": "8.2.3", @@ -58,7 +58,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0" + "@opentelemetry/instrumentation": "^0.34.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-lru-memoizer#readme" } diff --git a/plugins/node/instrumentation-mongoose/package.json b/plugins/node/instrumentation-mongoose/package.json index 0279cd947f..20f10073f2 100644 --- a/plugins/node/instrumentation-mongoose/package.json +++ b/plugins/node/instrumentation-mongoose/package.json @@ -42,12 +42,12 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "expect": "27.4.2", @@ -61,8 +61,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-mongoose#readme" diff --git a/plugins/node/instrumentation-tedious/package.json b/plugins/node/instrumentation-tedious/package.json index d263bcad61..944d8adbcd 100644 --- a/plugins/node/instrumentation-tedious/package.json +++ b/plugins/node/instrumentation-tedious/package.json @@ -44,13 +44,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -63,7 +63,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/tedious": "^4.0.6" }, diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index 322b7da82b..b6ef0073de 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -42,13 +42,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/core": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -61,7 +61,7 @@ "dependencies": { "@opentelemetry/instrumentation": "^0.32.0", "@opentelemetry/propagator-aws-xray": "^1.1.1", - "@opentelemetry/resources": "^1.0.0", + "@opentelemetry/resources": "^1.8.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/aws-lambda": "8.10.81" }, diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json index 88d956b078..e66b907c54 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json @@ -43,11 +43,11 @@ "watch": "tsc -w" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@opentelemetry/propagation-utils": "^0.29.0" }, @@ -58,9 +58,9 @@ "@aws-sdk/client-sqs": "3.85.0", "@aws-sdk/client-sns": "3.85.0", "@aws-sdk/types": "3.78.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.6", diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/package.json b/plugins/node/opentelemetry-instrumentation-bunyan/package.json index 2bcb3981bc..4f5fba6e57 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/package.json +++ b/plugins/node/opentelemetry-instrumentation-bunyan/package.json @@ -44,13 +44,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -65,7 +65,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@types/bunyan": "1.8.7" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-bunyan#readme" diff --git a/plugins/node/opentelemetry-instrumentation-cassandra/package.json b/plugins/node/opentelemetry-instrumentation-cassandra/package.json index c3173cadfb..c909ae4256 100644 --- a/plugins/node/opentelemetry-instrumentation-cassandra/package.json +++ b/plugins/node/opentelemetry-instrumentation-cassandra/package.json @@ -43,14 +43,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -65,7 +65,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-cassandra#readme" diff --git a/plugins/node/opentelemetry-instrumentation-connect/package.json b/plugins/node/opentelemetry-instrumentation-connect/package.json index 90b059495b..cbfafe2021 100644 --- a/plugins/node/opentelemetry-instrumentation-connect/package.json +++ b/plugins/node/opentelemetry-instrumentation-connect/package.json @@ -41,13 +41,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "connect": "3.7.0", @@ -59,8 +59,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/connect": "3.4.35" }, diff --git a/plugins/node/opentelemetry-instrumentation-dns/package.json b/plugins/node/opentelemetry-instrumentation-dns/package.json index 915a17c704..b1e7463e1e 100644 --- a/plugins/node/opentelemetry-instrumentation-dns/package.json +++ b/plugins/node/opentelemetry-instrumentation-dns/package.json @@ -42,13 +42,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/core": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -63,7 +63,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "semver": "^7.3.2" }, diff --git a/plugins/node/opentelemetry-instrumentation-express/package.json b/plugins/node/opentelemetry-instrumentation-express/package.json index 9e9ec55e6e..306af44228 100644 --- a/plugins/node/opentelemetry-instrumentation-express/package.json +++ b/plugins/node/opentelemetry-instrumentation-express/package.json @@ -45,13 +45,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.9", @@ -66,8 +66,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/express": "4.17.13" }, diff --git a/plugins/node/opentelemetry-instrumentation-fastify/package.json b/plugins/node/opentelemetry-instrumentation-fastify/package.json index 71b0a1b843..f9f3c1a5d7 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/package.json +++ b/plugins/node/opentelemetry-instrumentation-fastify/package.json @@ -42,15 +42,15 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@fastify/express": "^2.0.2", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/instrumentation-http": "0.30.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/express": "4.17.13", "@types/mocha": "7.0.2", "@types/node": "18.11.7", @@ -63,8 +63,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-fastify#readme" diff --git a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json index 20c5add2c7..fdfc2a2ffc 100644 --- a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json +++ b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json @@ -42,13 +42,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -62,7 +62,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/generic-pool": "^3.1.9" }, diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index 8eb844c1f2..1fd6ddb57d 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -44,11 +44,11 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/semantic-conventions": "^1.3.1", "@types/mocha": "8.2.3", "@types/node": "18.11.7", @@ -62,7 +62,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0" + "@opentelemetry/instrumentation": "^0.34.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-graphql#readme" } diff --git a/plugins/node/opentelemetry-instrumentation-hapi/package.json b/plugins/node/opentelemetry-instrumentation-hapi/package.json index 33b622d037..32038de3e1 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/package.json +++ b/plugins/node/opentelemetry-instrumentation-hapi/package.json @@ -42,14 +42,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@hapi/hapi": "20.1.5", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -60,8 +60,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/hapi__hapi": "20.0.9" }, diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/package.json b/plugins/node/opentelemetry-instrumentation-ioredis/package.json index 9ac5cbc7f8..5d675d968f 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/package.json +++ b/plugins/node/opentelemetry-instrumentation-ioredis/package.json @@ -47,14 +47,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/sinon": "10.0.9", "@types/node": "18.11.7", @@ -70,7 +70,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/ioredis": "4.26.6" }, diff --git a/plugins/node/opentelemetry-instrumentation-knex/package.json b/plugins/node/opentelemetry-instrumentation-knex/package.json index 68b687e507..760c507c07 100644 --- a/plugins/node/opentelemetry-instrumentation-knex/package.json +++ b/plugins/node/opentelemetry-instrumentation-knex/package.json @@ -42,13 +42,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -61,7 +61,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-knex#readme" diff --git a/plugins/node/opentelemetry-instrumentation-koa/package.json b/plugins/node/opentelemetry-instrumentation-koa/package.json index 292f455199..0eb1499877 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/package.json +++ b/plugins/node/opentelemetry-instrumentation-koa/package.json @@ -46,14 +46,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@koa/router": "9.4.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.9", @@ -68,8 +68,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/koa": "2.13.4", "@types/koa__router": "8.0.7" diff --git a/plugins/node/opentelemetry-instrumentation-memcached/package.json b/plugins/node/opentelemetry-instrumentation-memcached/package.json index 2b8a05cc60..3b6fdfbc24 100644 --- a/plugins/node/opentelemetry-instrumentation-memcached/package.json +++ b/plugins/node/opentelemetry-instrumentation-memcached/package.json @@ -44,14 +44,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "cross-env": "7.0.3", @@ -64,7 +64,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/memcached": "^2.2.6" }, diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/package.json index 6cd13f4079..0ceeeeb2c6 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/package.json @@ -47,14 +47,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/context-async-hooks": "^1.8.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -68,7 +68,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb#readme" diff --git a/plugins/node/opentelemetry-instrumentation-mysql/package.json b/plugins/node/opentelemetry-instrumentation-mysql/package.json index 41d9e54329..c0c82662ec 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql/package.json @@ -43,13 +43,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.13", @@ -63,7 +63,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/mysql": "2.15.19" }, diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/package.json b/plugins/node/opentelemetry-instrumentation-mysql2/package.json index ee7aacedca..1e34e9a4e5 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql2/package.json @@ -44,13 +44,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/mysql2": "github:types/mysql2", "@types/node": "18.11.7", @@ -66,7 +66,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql2#readme" diff --git a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json index c631d530e4..63dc315995 100644 --- a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json +++ b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json @@ -45,7 +45,7 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@nestjs/common": "8.2.6", @@ -53,10 +53,10 @@ "@nestjs/microservices": "8.2.6", "@nestjs/platform-express": "8.2.6", "@nestjs/websockets": "8.2.6", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -75,7 +75,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-nestjs-core#readme" diff --git a/plugins/node/opentelemetry-instrumentation-net/package.json b/plugins/node/opentelemetry-instrumentation-net/package.json index 4339a93d0d..c56be973fc 100644 --- a/plugins/node/opentelemetry-instrumentation-net/package.json +++ b/plugins/node/opentelemetry-instrumentation-net/package.json @@ -43,12 +43,12 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -61,7 +61,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-net#readme" diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index 088d729175..351d5ae02f 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -50,14 +50,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "cross-env": "7.0.3", @@ -72,7 +72,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/pg": "8.6.1", "@types/pg-pool": "2.0.3" diff --git a/plugins/node/opentelemetry-instrumentation-pino/package.json b/plugins/node/opentelemetry-instrumentation-pino/package.json index 2e4b241873..1a489fab6e 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/package.json +++ b/plugins/node/opentelemetry-instrumentation-pino/package.json @@ -44,13 +44,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/semver": "7.3.8", @@ -67,7 +67,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0" + "@opentelemetry/instrumentation": "^0.34.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pino#readme" } diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/package.json b/plugins/node/opentelemetry-instrumentation-redis-4/package.json index 2f5ce02cbf..1bf055252e 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis-4/package.json @@ -48,15 +48,15 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/core": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", + "@opentelemetry/core": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "cross-env": "7.0.3", @@ -70,7 +70,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis-4#readme" diff --git a/plugins/node/opentelemetry-instrumentation-redis/package.json b/plugins/node/opentelemetry-instrumentation-redis/package.json index ff5100799c..54dad805eb 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/package.json @@ -49,14 +49,14 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/contrib-test-utils": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "cross-env": "7.0.3", @@ -70,7 +70,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/redis": "2.8.31" }, diff --git a/plugins/node/opentelemetry-instrumentation-restify/package.json b/plugins/node/opentelemetry-instrumentation-restify/package.json index 36ab1135f7..3914f86208 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/package.json +++ b/plugins/node/opentelemetry-instrumentation-restify/package.json @@ -43,13 +43,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/restify": "4.3.8", @@ -65,8 +65,8 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-restify#readme" diff --git a/plugins/node/opentelemetry-instrumentation-router/package.json b/plugins/node/opentelemetry-instrumentation-router/package.json index bbe101b59c..94f47640e4 100644 --- a/plugins/node/opentelemetry-instrumentation-router/package.json +++ b/plugins/node/opentelemetry-instrumentation-router/package.json @@ -42,13 +42,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "gts": "3.1.0", @@ -60,7 +60,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-router#readme" diff --git a/plugins/node/opentelemetry-instrumentation-winston/package.json b/plugins/node/opentelemetry-instrumentation-winston/package.json index 2250b0b10e..1aa464cb64 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/package.json +++ b/plugins/node/opentelemetry-instrumentation-winston/package.json @@ -44,13 +44,13 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-async-hooks": "^1.3.1", - "@opentelemetry/sdk-trace-base": "^1.3.1", - "@opentelemetry/sdk-trace-node": "^1.3.1", + "@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", "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -66,7 +66,7 @@ "winston2": "npm:winston@2.4.5" }, "dependencies": { - "@opentelemetry/instrumentation": "^0.32.0" + "@opentelemetry/instrumentation": "^0.34.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-winston#readme" } diff --git a/plugins/web/opentelemetry-instrumentation-document-load/package.json b/plugins/web/opentelemetry-instrumentation-document-load/package.json index 6a3e000fd0..6c9f8913db 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/package.json +++ b/plugins/web/opentelemetry-instrumentation-document-load/package.json @@ -47,11 +47,11 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -77,10 +77,10 @@ "webpack-merge": "5.8.0" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/sdk-trace-base": "^1.0.0", - "@opentelemetry/sdk-trace-web": "^1.0.0", + "@opentelemetry/sdk-trace-web": "^1.8.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-document-load#readme" diff --git a/plugins/web/opentelemetry-instrumentation-long-task/package.json b/plugins/web/opentelemetry-instrumentation-long-task/package.json index 5f639b78d0..101e47457f 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/package.json +++ b/plugins/web/opentelemetry-instrumentation-long-task/package.json @@ -48,8 +48,8 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/jquery": "3.5.6", "@types/mocha": "7.0.2", "@types/node": "18.11.7", @@ -78,12 +78,12 @@ "zone.js": "0.11.4" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/sdk-trace-web": "^1.0.0" + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/sdk-trace-web": "^1.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "sideEffects": false, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-long-task#readme" diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json index 7d3695f912..9350a877de 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json @@ -48,10 +48,10 @@ }, "devDependencies": { "@babel/core": "7.15.0", - "@opentelemetry/api": "^1.0.0", - "@opentelemetry/context-zone-peer-dep": "^1.3.1", - "@opentelemetry/instrumentation-xml-http-request": "^0.32.0", - "@opentelemetry/sdk-trace-base": "^1.3.1", + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/context-zone-peer-dep": "^1.8.0", + "@opentelemetry/instrumentation-xml-http-request": "^0.34.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/jquery": "3.5.6", "@types/mocha": "7.0.2", "@types/node": "18.11.7", @@ -80,12 +80,12 @@ "zone.js": "0.11.4" }, "dependencies": { - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/instrumentation": "^0.32.0", - "@opentelemetry/sdk-trace-web": "^1.0.0" + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/sdk-trace-web": "^1.8.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "zone.js": "0.11.4" }, "sideEffects": false, From 7f02de23c3cedd6198bfd838e6b63002c3341bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Wed, 16 Nov 2022 14:31:13 +0100 Subject: [PATCH 03/91] feat: use GA version of metrics (#1281) * feat: use GA version of metrics Update host-metrics to use the GA version of metrics SDK and no longer use api-metrics. Remove metrics packages from experimental OTel renovate config. * chore: use MetricsAttributes => Attributes * chore: remove unused dependency --- packages/opentelemetry-host-metrics/package.json | 8 +++----- packages/opentelemetry-host-metrics/src/BaseMetrics.ts | 5 ++--- packages/opentelemetry-host-metrics/src/metric.ts | 2 +- packages/opentelemetry-host-metrics/test/metric.test.ts | 8 ++++---- renovate.json | 9 ++++++++- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/packages/opentelemetry-host-metrics/package.json b/packages/opentelemetry-host-metrics/package.json index 374c7a6beb..7c924a7f30 100644 --- a/packages/opentelemetry-host-metrics/package.json +++ b/packages/opentelemetry-host-metrics/package.json @@ -43,10 +43,10 @@ "access": "public" }, "peerDependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "devDependencies": { - "@opentelemetry/api": "^1.0.0", + "@opentelemetry/api": "^1.3.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.2", @@ -59,9 +59,7 @@ "typescript": "4.3.5" }, "dependencies": { - "@opentelemetry/api-metrics": "^0.32.0", - "@opentelemetry/core": "^1.0.0", - "@opentelemetry/sdk-metrics": "^0.32.0", + "@opentelemetry/sdk-metrics": "^1.8.0", "systeminformation": "^5.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/opentelemetry-host-metrics#readme" diff --git a/packages/opentelemetry-host-metrics/src/BaseMetrics.ts b/packages/opentelemetry-host-metrics/src/BaseMetrics.ts index 6bc4774f43..e859a5f7cf 100644 --- a/packages/opentelemetry-host-metrics/src/BaseMetrics.ts +++ b/packages/opentelemetry-host-metrics/src/BaseMetrics.ts @@ -15,7 +15,6 @@ */ import * as api from '@opentelemetry/api'; -import * as apiMetrics from '@opentelemetry/api-metrics'; import * as metrics from '@opentelemetry/sdk-metrics'; import { VERSION } from './version'; @@ -45,7 +44,7 @@ const DEFAULT_NAME = 'opentelemetry-host-metrics'; export abstract class BaseMetrics { protected _logger = api.diag; protected _maxTimeoutUpdateMS: number; - protected _meter: apiMetrics.Meter; + protected _meter: api.Meter; private _name: string; constructor(config: MetricsCollectorConfig) { @@ -53,7 +52,7 @@ export abstract class BaseMetrics { this._maxTimeoutUpdateMS = config.maxTimeoutUpdateMS || DEFAULT_MAX_TIMEOUT_UPDATE_MS; const meterProvider = - config.meterProvider! || apiMetrics.metrics.getMeterProvider(); + config.meterProvider! || api.metrics.getMeterProvider(); if (!config.meterProvider) { this._logger.warn('No meter provider, using default'); } diff --git a/packages/opentelemetry-host-metrics/src/metric.ts b/packages/opentelemetry-host-metrics/src/metric.ts index 11ea1ed910..3dae2efbe4 100644 --- a/packages/opentelemetry-host-metrics/src/metric.ts +++ b/packages/opentelemetry-host-metrics/src/metric.ts @@ -15,7 +15,7 @@ */ import { BaseMetrics } from './BaseMetrics'; -import * as api from '@opentelemetry/api-metrics'; +import * as api from '@opentelemetry/api'; import * as enums from './enum'; import { getCpuUsageData, getMemoryData } from './stats/common'; diff --git a/packages/opentelemetry-host-metrics/test/metric.test.ts b/packages/opentelemetry-host-metrics/test/metric.test.ts index 9c16815aac..72a1395ca5 100644 --- a/packages/opentelemetry-host-metrics/test/metric.test.ts +++ b/packages/opentelemetry-host-metrics/test/metric.test.ts @@ -15,7 +15,7 @@ */ const SI = require('systeminformation'); -import { MetricAttributes } from '@opentelemetry/api-metrics'; +import { Attributes } from '@opentelemetry/api'; import { AggregationTemporality, DataPoint, @@ -33,7 +33,7 @@ const cpuJson = require('./mocks/cpu.json'); const networkJson = require('./mocks/network.json'); class TestMetricReader extends MetricReader { - public selectAggregationTemporality(): AggregationTemporality { + public override selectAggregationTemporality(): AggregationTemporality { return AggregationTemporality.CUMULATIVE; } protected async onForceFlush(): Promise {} @@ -231,7 +231,7 @@ async function getRecords( function ensureValue( metric: MetricData, - attributes: MetricAttributes, + attributes: Attributes, value: number ) { const attrHash = hashAttributes(attributes); @@ -247,7 +247,7 @@ function ensureValue( assert.strictEqual(aggValue, value); } -function hashAttributes(attributes: MetricAttributes) { +function hashAttributes(attributes: Attributes) { return Object.entries(attributes) .sort(([a], [b]) => { return a < b ? -1 : 1; diff --git a/renovate.json b/renovate.json index fea5254ddb..d8b54711fc 100644 --- a/renovate.json +++ b/renovate.json @@ -14,7 +14,14 @@ }, { "groupName": "Otel Core experimental", - "matchPackageNames": ["@opentelemetry/sdk-node", "@opentelemetry/instrumentation", "@opentelemetry/instrumentation-grpc", "@opentelemetry/instrumentation-http", "@opentelemetry/instrumentation-fetch", "@opentelemetry/instrumentation-xml-http-request", "@opentelemetry/api-metrics", "@opentelemetry/sdk-metrics" ], + "matchPackageNames": [ + "@opentelemetry/instrumentation", + "@opentelemetry/instrumentation-grpc", + "@opentelemetry/instrumentation-http", + "@opentelemetry/instrumentation-fetch", + "@opentelemetry/instrumentation-xml-http-request", + "@opentelemetry/sdk-node" + ], "rangeStrategy": "bump" } ], From fedb4a65aba709cb534e89bece1254f9494c0306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Wed, 16 Nov 2022 16:59:03 +0100 Subject: [PATCH 04/91] chore: update fastify dev-dependency instrumentation-http to 0.34.0 (#1289) Co-authored-by: Daniel Dyla --- plugins/node/opentelemetry-instrumentation-fastify/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-fastify/package.json b/plugins/node/opentelemetry-instrumentation-fastify/package.json index f9f3c1a5d7..0495cc6f05 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/package.json +++ b/plugins/node/opentelemetry-instrumentation-fastify/package.json @@ -48,7 +48,7 @@ "@fastify/express": "^2.0.2", "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/instrumentation-http": "0.30.0", + "@opentelemetry/instrumentation-http": "0.34.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/express": "4.17.13", From 59fa57cfd0dff4ae0e6f3833dff73c55dfd79ee5 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Wed, 16 Nov 2022 13:32:35 -0500 Subject: [PATCH 05/91] chore: release main (#1269) --- .release-please-manifest.json | 2 +- .../CHANGELOG.md | 6 ++ .../package.json | 4 +- .../CHANGELOG.md | 6 ++ .../package.json | 4 +- .../CHANGELOG.md | 6 ++ .../package.json | 4 +- .../CHANGELOG.md | 6 ++ .../package.json | 4 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../auto-instrumentations-node/CHANGELOG.md | 46 +++++++++++++ .../auto-instrumentations-node/package.json | 68 +++++++++---------- .../auto-instrumentations-web/CHANGELOG.md | 15 ++++ .../auto-instrumentations-web/package.json | 6 +- .../opentelemetry-host-metrics/CHANGELOG.md | 7 ++ .../opentelemetry-host-metrics/package.json | 2 +- .../CHANGELOG.md | 6 ++ .../package.json | 4 +- .../opentelemetry-test-utils/CHANGELOG.md | 7 ++ .../opentelemetry-test-utils/package.json | 2 +- .../node/instrumentation-amqplib/CHANGELOG.md | 14 ++++ .../node/instrumentation-amqplib/package.json | 4 +- .../instrumentation-dataloader/CHANGELOG.md | 7 ++ .../instrumentation-dataloader/package.json | 2 +- plugins/node/instrumentation-fs/CHANGELOG.md | 7 ++ plugins/node/instrumentation-fs/package.json | 2 +- .../instrumentation-lru-memoizer/CHANGELOG.md | 14 ++++ .../instrumentation-lru-memoizer/package.json | 4 +- .../instrumentation-mongoose/CHANGELOG.md | 14 ++++ .../instrumentation-mongoose/package.json | 4 +- .../node/instrumentation-tedious/CHANGELOG.md | 14 ++++ .../node/instrumentation-tedious/package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 16 +++++ .../package.json | 6 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 13 ++++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 13 ++++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 14 ++++ .../package.json | 4 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- .../CHANGELOG.md | 7 ++ .../package.json | 2 +- 93 files changed, 586 insertions(+), 103 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ec840c24d3..3abf9b2078 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,2 +1,2 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.2","detectors/node/opentelemetry-resource-detector-aws":"1.2.0","detectors/node/opentelemetry-resource-detector-container":"0.2.0","detectors/node/opentelemetry-resource-detector-gcp":"0.27.3","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.3.0","metapackages/auto-instrumentations-node":"0.34.0","metapackages/auto-instrumentations-web":"0.30.1","packages/opentelemetry-host-metrics":"0.30.1","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.0","packages/opentelemetry-test-utils":"0.32.0","plugins/node/instrumentation-amqplib":"0.31.0","plugins/node/instrumentation-dataloader":"0.2.1","plugins/node/instrumentation-fs":"0.5.1","plugins/node/instrumentation-lru-memoizer":"0.31.0","plugins/node/instrumentation-mongoose":"0.31.1","plugins/node/instrumentation-tedious":"0.4.1","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.33.1","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.9.3","plugins/node/opentelemetry-instrumentation-bunyan":"0.30.1","plugins/node/opentelemetry-instrumentation-cassandra":"0.31.0","plugins/node/opentelemetry-instrumentation-connect":"0.30.1","plugins/node/opentelemetry-instrumentation-dns":"0.30.1","plugins/node/opentelemetry-instrumentation-express":"0.31.3","plugins/node/opentelemetry-instrumentation-fastify":"0.30.1","plugins/node/opentelemetry-instrumentation-generic-pool":"0.30.0","plugins/node/opentelemetry-instrumentation-graphql":"0.32.0","plugins/node/opentelemetry-instrumentation-hapi":"0.30.1","plugins/node/opentelemetry-instrumentation-ioredis":"0.32.2","plugins/node/opentelemetry-instrumentation-knex":"0.30.1","plugins/node/opentelemetry-instrumentation-koa":"0.33.0","plugins/node/opentelemetry-instrumentation-memcached":"0.30.1","plugins/node/opentelemetry-instrumentation-mongodb":"0.32.2","plugins/node/opentelemetry-instrumentation-mysql":"0.31.2","plugins/node/opentelemetry-instrumentation-mysql2":"0.32.1","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.31.1","plugins/node/opentelemetry-instrumentation-net":"0.30.2","plugins/node/opentelemetry-instrumentation-pg":"0.32.0","plugins/node/opentelemetry-instrumentation-pino":"0.32.1","plugins/node/opentelemetry-instrumentation-redis":"0.33.1","plugins/node/opentelemetry-instrumentation-redis-4":"0.33.1","plugins/node/opentelemetry-instrumentation-restify":"0.30.1","plugins/node/opentelemetry-instrumentation-router":"0.31.0","plugins/node/opentelemetry-instrumentation-winston":"0.30.1","plugins/web/opentelemetry-instrumentation-document-load":"0.30.1","plugins/web/opentelemetry-instrumentation-long-task":"0.31.1","plugins/web/opentelemetry-instrumentation-user-interaction":"0.31.1","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} diff --git a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/CHANGELOG.md index 008ddfc8fe..0e2b0b8b12 100644 --- a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/CHANGELOG.md @@ -12,6 +12,12 @@ * devDependencies * @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.32.0 +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.27.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-alibaba-cloud-v0.26.2...resource-detector-alibaba-cloud-v0.27.0) (2022-05-14) diff --git a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json index 88cb6fd8f5..2c7a10b053 100644 --- a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json +++ b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-alibaba-cloud", - "version": "0.27.2", + "version": "0.27.3", "description": "OpenTelemetry resource detector for Alibaba Cloud", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -43,7 +43,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.2", diff --git a/detectors/node/opentelemetry-resource-detector-aws/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-aws/CHANGELOG.md index a23c22bb39..54d32e45f2 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-aws/CHANGELOG.md @@ -12,6 +12,12 @@ * devDependencies * @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.32.0 +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [1.2.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-aws-v1.1.2...resource-detector-aws-v1.2.0) (2022-11-02) diff --git a/detectors/node/opentelemetry-resource-detector-aws/package.json b/detectors/node/opentelemetry-resource-detector-aws/package.json index 05abb595d9..11e334c6e8 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/package.json +++ b/detectors/node/opentelemetry-resource-detector-aws/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-aws", - "version": "1.2.0", + "version": "1.2.1", "description": "OpenTelemetry SDK resource detector for AWS", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -42,7 +42,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/sinon": "10.0.2", diff --git a/detectors/node/opentelemetry-resource-detector-container/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-container/CHANGELOG.md index 1cc86f0097..771a433cf7 100644 --- a/detectors/node/opentelemetry-resource-detector-container/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-container/CHANGELOG.md @@ -6,6 +6,12 @@ * devDependencies * @opentelemetry/contrib-test-utils bumped from ^0.30.0 to ^0.31.0 +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.2.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-container-v0.1.2...resource-detector-container-v0.2.0) (2022-11-02) diff --git a/detectors/node/opentelemetry-resource-detector-container/package.json b/detectors/node/opentelemetry-resource-detector-container/package.json index af32bb9d80..78689d8f37 100644 --- a/detectors/node/opentelemetry-resource-detector-container/package.json +++ b/detectors/node/opentelemetry-resource-detector-container/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-container", - "version": "0.2.0", + "version": "0.2.1", "description": "Opentelemetry resource detector to get container resource attributes", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -36,7 +36,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/mocha": "8.2.3", "@types/node": "^18.0.0", "@types/sinon": "10.0.2", diff --git a/detectors/node/opentelemetry-resource-detector-gcp/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-gcp/CHANGELOG.md index 58b25bfbc6..c412d091e7 100644 --- a/detectors/node/opentelemetry-resource-detector-gcp/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-gcp/CHANGELOG.md @@ -12,6 +12,12 @@ * devDependencies * @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.32.0 +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.27.3](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-gcp-v0.27.2...resource-detector-gcp-v0.27.3) (2022-11-02) diff --git a/detectors/node/opentelemetry-resource-detector-gcp/package.json b/detectors/node/opentelemetry-resource-detector-gcp/package.json index bb5aade21d..ee967ff069 100644 --- a/detectors/node/opentelemetry-resource-detector-gcp/package.json +++ b/detectors/node/opentelemetry-resource-detector-gcp/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-gcp", - "version": "0.27.3", + "version": "0.27.4", "description": "OpenTelemetry SDK resource detector for GCP", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -42,7 +42,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", "@types/semver": "7.3.8", diff --git a/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md b/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md index e9132a489d..750990d5a1 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md +++ b/detectors/node/opentelemetry-resource-detector-instana/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.4.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-instana-v0.3.0...resource-detector-instana-v0.4.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.3.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/resource-detector-instana-v0.2.0...resource-detector-instana-v0.3.0) (2022-09-02) diff --git a/detectors/node/opentelemetry-resource-detector-instana/package.json b/detectors/node/opentelemetry-resource-detector-instana/package.json index 4c1266cffc..df945306f3 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/package.json +++ b/detectors/node/opentelemetry-resource-detector-instana/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/resource-detector-instana", - "version": "0.3.0", + "version": "0.4.0", "description": "OpenTelemetry SDK resource detector for Instana", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -40,7 +40,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-node": "^0.34.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", diff --git a/metapackages/auto-instrumentations-node/CHANGELOG.md b/metapackages/auto-instrumentations-node/CHANGELOG.md index 709535cb7f..06f7a2d796 100644 --- a/metapackages/auto-instrumentations-node/CHANGELOG.md +++ b/metapackages/auto-instrumentations-node/CHANGELOG.md @@ -52,6 +52,52 @@ * dependencies * @opentelemetry/instrumentation-express bumped from ^0.31.1 to ^0.31.2 +## [0.35.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.34.0...auto-instrumentations-node-v0.35.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/instrumentation-amqplib bumped from ^0.31.0 to ^0.32.0 + * @opentelemetry/instrumentation-aws-lambda bumped from ^0.33.1 to ^0.34.0 + * @opentelemetry/instrumentation-aws-sdk bumped from ^0.9.3 to ^0.10.0 + * @opentelemetry/instrumentation-bunyan bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-cassandra-driver bumped from ^0.31.0 to ^0.32.0 + * @opentelemetry/instrumentation-connect bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-dataloader bumped from ^0.2.1 to ^0.3.0 + * @opentelemetry/instrumentation-dns bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-express bumped from ^0.31.3 to ^0.32.0 + * @opentelemetry/instrumentation-fs bumped from ^0.5.1 to ^0.6.0 + * @opentelemetry/instrumentation-fastify bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-generic-pool bumped from ^0.30.0 to ^0.31.0 + * @opentelemetry/instrumentation-graphql bumped from ^0.32.0 to ^0.33.0 + * @opentelemetry/instrumentation-hapi bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-ioredis bumped from ^0.32.2 to ^0.33.0 + * @opentelemetry/instrumentation-knex bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-koa bumped from ^0.33.0 to ^0.34.0 + * @opentelemetry/instrumentation-lru-memoizer bumped from ^0.31.0 to ^0.32.0 + * @opentelemetry/instrumentation-memcached bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-mongodb bumped from ^0.32.2 to ^0.33.0 + * @opentelemetry/instrumentation-mongoose bumped from ^0.31.1 to ^0.32.0 + * @opentelemetry/instrumentation-mysql bumped from ^0.31.2 to ^0.32.0 + * @opentelemetry/instrumentation-mysql2 bumped from ^0.32.1 to ^0.33.0 + * @opentelemetry/instrumentation-nestjs-core bumped from ^0.31.1 to ^0.32.0 + * @opentelemetry/instrumentation-net bumped from ^0.30.2 to ^0.31.0 + * @opentelemetry/instrumentation-pg bumped from ^0.32.0 to ^0.33.0 + * @opentelemetry/instrumentation-pino bumped from ^0.32.1 to ^0.33.0 + * @opentelemetry/instrumentation-redis bumped from ^0.33.1 to ^0.34.0 + * @opentelemetry/instrumentation-redis-4 bumped from ^0.33.1 to ^0.34.0 + * @opentelemetry/instrumentation-restify bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-router bumped from ^0.31.0 to ^0.32.0 + * @opentelemetry/instrumentation-tedious bumped from ^0.4.1 to ^0.5.0 + * @opentelemetry/instrumentation-winston bumped from ^0.30.1 to ^0.31.0 + ## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.33.1...auto-instrumentations-node-v0.34.0) (2022-11-02) diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index abc61819b9..255857d49a 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/auto-instrumentations-node", - "version": "0.34.0", + "version": "0.35.0", "description": "Metapackage which bundles opentelemetry node core and contrib instrumentations", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node#readme", @@ -47,40 +47,40 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", - "@opentelemetry/instrumentation-amqplib": "^0.31.0", - "@opentelemetry/instrumentation-aws-lambda": "^0.33.1", - "@opentelemetry/instrumentation-aws-sdk": "^0.9.3", - "@opentelemetry/instrumentation-bunyan": "^0.30.1", - "@opentelemetry/instrumentation-cassandra-driver": "^0.31.0", - "@opentelemetry/instrumentation-connect": "^0.30.1", - "@opentelemetry/instrumentation-dataloader": "^0.2.1", - "@opentelemetry/instrumentation-dns": "^0.30.1", - "@opentelemetry/instrumentation-express": "^0.31.3", - "@opentelemetry/instrumentation-fs": "^0.5.1", - "@opentelemetry/instrumentation-fastify": "^0.30.1", - "@opentelemetry/instrumentation-generic-pool": "^0.30.0", - "@opentelemetry/instrumentation-graphql": "^0.32.0", + "@opentelemetry/instrumentation-amqplib": "^0.32.0", + "@opentelemetry/instrumentation-aws-lambda": "^0.34.0", + "@opentelemetry/instrumentation-aws-sdk": "^0.10.0", + "@opentelemetry/instrumentation-bunyan": "^0.31.0", + "@opentelemetry/instrumentation-cassandra-driver": "^0.32.0", + "@opentelemetry/instrumentation-connect": "^0.31.0", + "@opentelemetry/instrumentation-dataloader": "^0.3.0", + "@opentelemetry/instrumentation-dns": "^0.31.0", + "@opentelemetry/instrumentation-express": "^0.32.0", + "@opentelemetry/instrumentation-fs": "^0.6.0", + "@opentelemetry/instrumentation-fastify": "^0.31.0", + "@opentelemetry/instrumentation-generic-pool": "^0.31.0", + "@opentelemetry/instrumentation-graphql": "^0.33.0", "@opentelemetry/instrumentation-grpc": "^0.34.0", - "@opentelemetry/instrumentation-hapi": "^0.30.1", + "@opentelemetry/instrumentation-hapi": "^0.31.0", "@opentelemetry/instrumentation-http": "^0.34.0", - "@opentelemetry/instrumentation-ioredis": "^0.32.2", - "@opentelemetry/instrumentation-knex": "^0.30.1", - "@opentelemetry/instrumentation-koa": "^0.33.0", - "@opentelemetry/instrumentation-lru-memoizer": "^0.31.0", - "@opentelemetry/instrumentation-memcached": "^0.30.1", - "@opentelemetry/instrumentation-mongodb": "^0.32.2", - "@opentelemetry/instrumentation-mongoose": "^0.31.1", - "@opentelemetry/instrumentation-mysql": "^0.31.2", - "@opentelemetry/instrumentation-mysql2": "^0.32.1", - "@opentelemetry/instrumentation-nestjs-core": "^0.31.1", - "@opentelemetry/instrumentation-net": "^0.30.2", - "@opentelemetry/instrumentation-pg": "^0.32.0", - "@opentelemetry/instrumentation-pino": "^0.32.1", - "@opentelemetry/instrumentation-redis": "^0.33.1", - "@opentelemetry/instrumentation-redis-4": "^0.33.1", - "@opentelemetry/instrumentation-restify": "^0.30.1", - "@opentelemetry/instrumentation-router": "^0.31.0", - "@opentelemetry/instrumentation-tedious": "^0.4.1", - "@opentelemetry/instrumentation-winston": "^0.30.1" + "@opentelemetry/instrumentation-ioredis": "^0.33.0", + "@opentelemetry/instrumentation-knex": "^0.31.0", + "@opentelemetry/instrumentation-koa": "^0.34.0", + "@opentelemetry/instrumentation-lru-memoizer": "^0.32.0", + "@opentelemetry/instrumentation-memcached": "^0.31.0", + "@opentelemetry/instrumentation-mongodb": "^0.33.0", + "@opentelemetry/instrumentation-mongoose": "^0.32.0", + "@opentelemetry/instrumentation-mysql": "^0.32.0", + "@opentelemetry/instrumentation-mysql2": "^0.33.0", + "@opentelemetry/instrumentation-nestjs-core": "^0.32.0", + "@opentelemetry/instrumentation-net": "^0.31.0", + "@opentelemetry/instrumentation-pg": "^0.33.0", + "@opentelemetry/instrumentation-pino": "^0.33.0", + "@opentelemetry/instrumentation-redis": "^0.34.0", + "@opentelemetry/instrumentation-redis-4": "^0.34.0", + "@opentelemetry/instrumentation-restify": "^0.31.0", + "@opentelemetry/instrumentation-router": "^0.32.0", + "@opentelemetry/instrumentation-tedious": "^0.5.0", + "@opentelemetry/instrumentation-winston": "^0.31.0" } } diff --git a/metapackages/auto-instrumentations-web/CHANGELOG.md b/metapackages/auto-instrumentations-web/CHANGELOG.md index 18b471391f..dcf39c08c8 100644 --- a/metapackages/auto-instrumentations-web/CHANGELOG.md +++ b/metapackages/auto-instrumentations-web/CHANGELOG.md @@ -6,6 +6,21 @@ * dependencies * @opentelemetry/instrumentation-user-interaction bumped from ^0.30.0 to ^0.30.1 +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-web-v0.30.1...auto-instrumentations-web-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/instrumentation-document-load bumped from ^0.30.1 to ^0.31.0 + * @opentelemetry/instrumentation-user-interaction bumped from ^0.31.1 to ^0.32.0 + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-web-v0.30.0...auto-instrumentations-web-v0.30.1) (2022-11-02) diff --git a/metapackages/auto-instrumentations-web/package.json b/metapackages/auto-instrumentations-web/package.json index 147829f4e0..c2b3753554 100644 --- a/metapackages/auto-instrumentations-web/package.json +++ b/metapackages/auto-instrumentations-web/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/auto-instrumentations-web", - "version": "0.30.1", + "version": "0.31.0", "description": "Metapackage which bundles opentelemetry node core and contrib instrumentations", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-web#readme", @@ -61,9 +61,9 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", - "@opentelemetry/instrumentation-document-load": "^0.30.1", + "@opentelemetry/instrumentation-document-load": "^0.31.0", "@opentelemetry/instrumentation-fetch": "^0.34.0", - "@opentelemetry/instrumentation-user-interaction": "^0.31.1", + "@opentelemetry/instrumentation-user-interaction": "^0.32.0", "@opentelemetry/instrumentation-xml-http-request": "^0.34.0" } } diff --git a/packages/opentelemetry-host-metrics/CHANGELOG.md b/packages/opentelemetry-host-metrics/CHANGELOG.md index c3b0717860..e8dceb7ddd 100644 --- a/packages/opentelemetry-host-metrics/CHANGELOG.md +++ b/packages/opentelemetry-host-metrics/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/host-metrics-v0.30.1...host-metrics-v0.31.0) (2022-11-16) + + +### Features + +* use GA version of metrics ([#1281](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1281)) ([7f02de2](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/7f02de23c3cedd6198bfd838e6b63002c3341bd8)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/host-metrics-v0.30.0...host-metrics-v0.30.1) (2022-09-27) diff --git a/packages/opentelemetry-host-metrics/package.json b/packages/opentelemetry-host-metrics/package.json index 7c924a7f30..73d619f4ae 100644 --- a/packages/opentelemetry-host-metrics/package.json +++ b/packages/opentelemetry-host-metrics/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/host-metrics", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry Host Metrics for Node.js", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/packages/opentelemetry-propagation-utils/CHANGELOG.md b/packages/opentelemetry-propagation-utils/CHANGELOG.md index 52b4058a4f..7601526a81 100644 --- a/packages/opentelemetry-propagation-utils/CHANGELOG.md +++ b/packages/opentelemetry-propagation-utils/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.31.0 to ^0.33.0 + ## [0.29.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/propagation-utils-v0.28.0...propagation-utils-v0.29.0) (2022-09-27) diff --git a/packages/opentelemetry-propagation-utils/package.json b/packages/opentelemetry-propagation-utils/package.json index e35153d111..adae4993a2 100644 --- a/packages/opentelemetry-propagation-utils/package.json +++ b/packages/opentelemetry-propagation-utils/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/propagation-utils", - "version": "0.29.0", + "version": "0.29.1", "description": "Propagation utilities for opentelemetry instrumentations", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -45,7 +45,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.0.0", - "@opentelemetry/contrib-test-utils": "^0.31.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/mocha": "^9.1.1", "@types/node": "18.11.7", "@types/sinon": "^10.0.11", diff --git a/packages/opentelemetry-test-utils/CHANGELOG.md b/packages/opentelemetry-test-utils/CHANGELOG.md index 172e54896a..4195ebaaa2 100644 --- a/packages/opentelemetry-test-utils/CHANGELOG.md +++ b/packages/opentelemetry-test-utils/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/contrib-test-utils-v0.32.0...contrib-test-utils-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/contrib-test-utils-v0.31.0...contrib-test-utils-v0.32.0) (2022-09-02) diff --git a/packages/opentelemetry-test-utils/package.json b/packages/opentelemetry-test-utils/package.json index bf26eed8c5..72cee473c5 100644 --- a/packages/opentelemetry-test-utils/package.json +++ b/packages/opentelemetry-test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/contrib-test-utils", - "version": "0.32.0", + "version": "0.33.0", "description": "Test utilities for opentelemetry components", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/instrumentation-amqplib/CHANGELOG.md b/plugins/node/instrumentation-amqplib/CHANGELOG.md index a12aa4da92..c0484c1aa0 100644 --- a/plugins/node/instrumentation-amqplib/CHANGELOG.md +++ b/plugins/node/instrumentation-amqplib/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-amqplib-v0.31.0...instrumentation-amqplib-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-amqplib-v0.30.0...instrumentation-amqplib-v0.31.0) (2022-09-02) diff --git a/plugins/node/instrumentation-amqplib/package.json b/plugins/node/instrumentation-amqplib/package.json index 789bee40d7..0588be63b9 100644 --- a/plugins/node/instrumentation-amqplib/package.json +++ b/plugins/node/instrumentation-amqplib/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-amqplib", - "version": "0.31.0", + "version": "0.32.0", "description": "OpenTelemetry automatic instrumentation for the `amqplib` package", "keywords": [ "amqplib", @@ -53,7 +53,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/lodash": "4.14.178", "@types/mocha": "8.2.3", "@types/sinon": "10.0.2", diff --git a/plugins/node/instrumentation-dataloader/CHANGELOG.md b/plugins/node/instrumentation-dataloader/CHANGELOG.md index acd6a4e565..6116c0cc7f 100644 --- a/plugins/node/instrumentation-dataloader/CHANGELOG.md +++ b/plugins/node/instrumentation-dataloader/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.3.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dataloader-v0.2.1...instrumentation-dataloader-v0.3.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.2.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dataloader-v0.2.0...instrumentation-dataloader-v0.2.1) (2022-11-02) diff --git a/plugins/node/instrumentation-dataloader/package.json b/plugins/node/instrumentation-dataloader/package.json index e714952935..630445dd7d 100644 --- a/plugins/node/instrumentation-dataloader/package.json +++ b/plugins/node/instrumentation-dataloader/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-dataloader", - "version": "0.2.1", + "version": "0.3.0", "description": "OpenTelemetry instrumentation for dataloader", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/instrumentation-fs/CHANGELOG.md b/plugins/node/instrumentation-fs/CHANGELOG.md index fa190b2e17..3c7feabca1 100644 --- a/plugins/node/instrumentation-fs/CHANGELOG.md +++ b/plugins/node/instrumentation-fs/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.6.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-fs-v0.5.1...instrumentation-fs-v0.6.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.5.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-fs-v0.5.0...instrumentation-fs-v0.5.1) (2022-11-02) diff --git a/plugins/node/instrumentation-fs/package.json b/plugins/node/instrumentation-fs/package.json index c5655d57ad..31f4102714 100644 --- a/plugins/node/instrumentation-fs/package.json +++ b/plugins/node/instrumentation-fs/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-fs", - "version": "0.5.1", + "version": "0.6.0", "description": "OpenTelemetry automatic instrumentation package for fs", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/instrumentation-lru-memoizer/CHANGELOG.md b/plugins/node/instrumentation-lru-memoizer/CHANGELOG.md index 3cde6a4bfa..59a4f68b07 100644 --- a/plugins/node/instrumentation-lru-memoizer/CHANGELOG.md +++ b/plugins/node/instrumentation-lru-memoizer/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-lru-memoizer-v0.31.0...instrumentation-lru-memoizer-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-lru-memoizer-v0.30.0...instrumentation-lru-memoizer-v0.31.0) (2022-09-02) diff --git a/plugins/node/instrumentation-lru-memoizer/package.json b/plugins/node/instrumentation-lru-memoizer/package.json index 6c309b6995..49c7e6e37d 100644 --- a/plugins/node/instrumentation-lru-memoizer/package.json +++ b/plugins/node/instrumentation-lru-memoizer/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-lru-memoizer", - "version": "0.31.0", + "version": "0.32.0", "description": "OpenTelemetry automatic instrumentation package for lru-memoizer", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -43,7 +43,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@types/lru-cache": "7.10.9", "@types/mocha": "8.2.3", "@types/node": "18.11.7", diff --git a/plugins/node/instrumentation-mongoose/CHANGELOG.md b/plugins/node/instrumentation-mongoose/CHANGELOG.md index 5250d17b4f..a3ed205e5e 100644 --- a/plugins/node/instrumentation-mongoose/CHANGELOG.md +++ b/plugins/node/instrumentation-mongoose/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongoose-v0.31.1...instrumentation-mongoose-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.31.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongoose-v0.31.0...instrumentation-mongoose-v0.31.1) (2022-11-02) diff --git a/plugins/node/instrumentation-mongoose/package.json b/plugins/node/instrumentation-mongoose/package.json index 20f10073f2..6edb5db039 100644 --- a/plugins/node/instrumentation-mongoose/package.json +++ b/plugins/node/instrumentation-mongoose/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-mongoose", - "version": "0.31.1", + "version": "0.32.0", "description": "OpenTelemetry automatic instrumentation package for mongoose", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -46,7 +46,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", diff --git a/plugins/node/instrumentation-tedious/CHANGELOG.md b/plugins/node/instrumentation-tedious/CHANGELOG.md index 6cee1df00f..8c767b5633 100644 --- a/plugins/node/instrumentation-tedious/CHANGELOG.md +++ b/plugins/node/instrumentation-tedious/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.5.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-tedious-v0.4.1...instrumentation-tedious-v0.5.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.4.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-tedious-v0.4.0...instrumentation-tedious-v0.4.1) (2022-11-02) diff --git a/plugins/node/instrumentation-tedious/package.json b/plugins/node/instrumentation-tedious/package.json index 944d8adbcd..a94a2675c5 100644 --- a/plugins/node/instrumentation-tedious/package.json +++ b/plugins/node/instrumentation-tedious/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-tedious", - "version": "0.4.1", + "version": "0.5.0", "description": "OpenTelemetry instrumentation for `tedious`", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-aws-lambda/CHANGELOG.md index f0661aaa96..1a2705a522 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-lambda-v0.33.1...instrumentation-aws-lambda-v0.34.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.33.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-lambda-v0.33.0...instrumentation-aws-lambda-v0.33.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index b6ef0073de..b0ebe04f97 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-aws-lambda", - "version": "0.33.1", + "version": "0.34.0", "description": "OpenTelemetry AWS Lambda automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-aws-sdk/CHANGELOG.md index dd9c135621..07ff694a46 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [0.10.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-sdk-v0.9.3...instrumentation-aws-sdk-v0.10.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/propagation-utils bumped from ^0.29.0 to ^0.29.1 + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.9.3](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-aws-sdk-v0.9.2...instrumentation-aws-sdk-v0.9.3) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json index e66b907c54..48cb5b90b5 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-aws-sdk", - "version": "0.9.3", + "version": "0.10.0", "description": "OpenTelemetry automatic instrumentation for the `aws-sdk` package", "keywords": [ "aws", @@ -49,7 +49,7 @@ "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", - "@opentelemetry/propagation-utils": "^0.29.0" + "@opentelemetry/propagation-utils": "^0.29.1" }, "devDependencies": { "@aws-sdk/client-dynamodb": "3.85.0", @@ -59,7 +59,7 @@ "@aws-sdk/client-sns": "3.85.0", "@aws-sdk/types": "3.78.0", "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-bunyan/CHANGELOG.md index a73061831e..8cf8741110 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-bunyan/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-bunyan-v0.30.1...instrumentation-bunyan-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-bunyan-v0.30.0...instrumentation-bunyan-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/package.json b/plugins/node/opentelemetry-instrumentation-bunyan/package.json index 4f5fba6e57..c6687f1c84 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/package.json +++ b/plugins/node/opentelemetry-instrumentation-bunyan/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-bunyan", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry instrumentation for bunyan", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-cassandra/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-cassandra/CHANGELOG.md index a9f73fee48..d1723c2f0d 100644 --- a/plugins/node/opentelemetry-instrumentation-cassandra/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-cassandra/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-cassandra-driver-v0.31.0...instrumentation-cassandra-driver-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-cassandra-driver-v0.30.0...instrumentation-cassandra-driver-v0.31.0) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-cassandra/package.json b/plugins/node/opentelemetry-instrumentation-cassandra/package.json index c909ae4256..50d51b02b4 100644 --- a/plugins/node/opentelemetry-instrumentation-cassandra/package.json +++ b/plugins/node/opentelemetry-instrumentation-cassandra/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-cassandra-driver", - "version": "0.31.0", + "version": "0.32.0", "description": "OpenTelemetry instrumentation for cassandra-driver", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,7 +48,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-connect/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-connect/CHANGELOG.md index 8551fe1108..1c65a240e1 100644 --- a/plugins/node/opentelemetry-instrumentation-connect/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-connect/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-connect-v0.30.1...instrumentation-connect-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-connect-v0.30.0...instrumentation-connect-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-connect/package.json b/plugins/node/opentelemetry-instrumentation-connect/package.json index cbfafe2021..790ad5e7d6 100644 --- a/plugins/node/opentelemetry-instrumentation-connect/package.json +++ b/plugins/node/opentelemetry-instrumentation-connect/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-connect", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry connect automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-dns/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-dns/CHANGELOG.md index b278c4b9ca..fbb0e93248 100644 --- a/plugins/node/opentelemetry-instrumentation-dns/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-dns/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dns-v0.30.1...instrumentation-dns-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-dns-v0.30.0...instrumentation-dns-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-dns/package.json b/plugins/node/opentelemetry-instrumentation-dns/package.json index b1e7463e1e..ca3b04ec97 100644 --- a/plugins/node/opentelemetry-instrumentation-dns/package.json +++ b/plugins/node/opentelemetry-instrumentation-dns/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-dns", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry dns automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-express/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-express/CHANGELOG.md index 1b3a87942b..abdba1b095 100644 --- a/plugins/node/opentelemetry-instrumentation-express/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-express/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-express-v0.31.3...instrumentation-express-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.31.3](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-express-v0.31.2...instrumentation-express-v0.31.3) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-express/package.json b/plugins/node/opentelemetry-instrumentation-express/package.json index 306af44228..84a26df0d2 100644 --- a/plugins/node/opentelemetry-instrumentation-express/package.json +++ b/plugins/node/opentelemetry-instrumentation-express/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-express", - "version": "0.31.3", + "version": "0.32.0", "description": "OpenTelemetry express automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-fastify/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-fastify/CHANGELOG.md index e3e13b0fe2..d6bf732326 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-fastify/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-fastify-v0.30.1...instrumentation-fastify-v0.31.0) (2022-11-16) + + +### Features + +* **fastify:** add requestHook support ([#1255](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1255)) ([c9923e3](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/c9923e3636649c67e5122531f164909b48dbb58d)) +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Bug Fixes + +* **instrumentation-fastify:** stop using fastify types in public api ([#1267](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1267)) ([40515c3](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/40515c3dca81d1c177d71af2663fce3b8813bbf2)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-fastify-v0.30.0...instrumentation-fastify-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-fastify/package.json b/plugins/node/opentelemetry-instrumentation-fastify/package.json index 0495cc6f05..116d217738 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/package.json +++ b/plugins/node/opentelemetry-instrumentation-fastify/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-fastify", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry fastify automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-generic-pool/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-generic-pool/CHANGELOG.md index 6af49a5b54..d1f65efaaf 100644 --- a/plugins/node/opentelemetry-instrumentation-generic-pool/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-generic-pool/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-generic-pool-v0.30.0...instrumentation-generic-pool-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-generic-pool-v0.29.0...instrumentation-generic-pool-v0.30.0) (2022-09-02) diff --git a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json index fdfc2a2ffc..eae64c64f9 100644 --- a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json +++ b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-generic-pool", - "version": "0.30.0", + "version": "0.31.0", "description": "OpenTelemetry Generic Pool automatic instrumentation package", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-graphql/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-graphql/CHANGELOG.md index c7c7b9bd79..db31c26569 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-graphql/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-graphql-v0.32.0...instrumentation-graphql-v0.33.0) (2022-11-16) + + +### Features + +* **graphql:** add ignoreTrivialResolveSpans config option ([#1256](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1256)) ([aff84bb](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/aff84bba1d391ec2061b8d0121ac8dd36fc1980c)) +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Bug Fixes + +* **instrumentation-graphql:** stop using types from `graphql` library in public api ([#1268](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1268)) ([f8cabf3](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/f8cabf306faa3e3eb4b9ce38ccdde842abdb2b82)) + ## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-graphql-v0.31.0...instrumentation-graphql-v0.32.0) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index 1fd6ddb57d..50ca91155e 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-graphql", - "version": "0.32.0", + "version": "0.33.0", "description": "OpenTelemetry @opentelemetry/instrumentation-graphql automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-hapi/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-hapi/CHANGELOG.md index 1fa8c69f40..0b926a512e 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-hapi/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-hapi-v0.30.1...instrumentation-hapi-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-hapi-v0.30.0...instrumentation-hapi-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-hapi/package.json b/plugins/node/opentelemetry-instrumentation-hapi/package.json index 32038de3e1..2caa49e01c 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/package.json +++ b/plugins/node/opentelemetry-instrumentation-hapi/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-hapi", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry Hapi automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md index aa5869ee41..804ea5d3cc 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-ioredis-v0.32.2...instrumentation-ioredis-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.32.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-ioredis-v0.32.1...instrumentation-ioredis-v0.32.2) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/package.json b/plugins/node/opentelemetry-instrumentation-ioredis/package.json index 5d675d968f..6fd3593ade 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/package.json +++ b/plugins/node/opentelemetry-instrumentation-ioredis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-ioredis", - "version": "0.32.2", + "version": "0.33.0", "description": "OpenTelemetry ioredis automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -52,7 +52,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-knex/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-knex/CHANGELOG.md index de3dff2f22..4899a4891a 100644 --- a/plugins/node/opentelemetry-instrumentation-knex/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-knex/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-knex-v0.30.1...instrumentation-knex-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-knex-v0.30.0...instrumentation-knex-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-knex/package.json b/plugins/node/opentelemetry-instrumentation-knex/package.json index 760c507c07..9a49d97f93 100644 --- a/plugins/node/opentelemetry-instrumentation-knex/package.json +++ b/plugins/node/opentelemetry-instrumentation-knex/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-knex", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry Knex automatic instrumentation package", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-koa/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-koa/CHANGELOG.md index 256429128b..393956fa28 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-koa/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-koa-v0.33.0...instrumentation-koa-v0.34.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-koa-v0.32.0...instrumentation-koa-v0.33.0) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-koa/package.json b/plugins/node/opentelemetry-instrumentation-koa/package.json index 0eb1499877..c29ba96578 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/package.json +++ b/plugins/node/opentelemetry-instrumentation-koa/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-koa", - "version": "0.33.0", + "version": "0.34.0", "description": "OpenTelemetry Koa automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-memcached/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-memcached/CHANGELOG.md index ce4ae15f4a..38a20ce01f 100644 --- a/plugins/node/opentelemetry-instrumentation-memcached/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-memcached/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-memcached-v0.30.1...instrumentation-memcached-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-memcached-v0.30.0...instrumentation-memcached-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-memcached/package.json b/plugins/node/opentelemetry-instrumentation-memcached/package.json index 3b6fdfbc24..4e09f64ae2 100644 --- a/plugins/node/opentelemetry-instrumentation-memcached/package.json +++ b/plugins/node/opentelemetry-instrumentation-memcached/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-memcached", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry memcached automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md index c302a9912c..eb2b6d7c88 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongodb-v0.32.2...instrumentation-mongodb-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.32.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongodb-v0.32.1...instrumentation-mongodb-v0.32.2) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/package.json index 0ceeeeb2c6..14a2b29b54 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-mongodb", - "version": "0.32.2", + "version": "0.33.0", "description": "OpenTelemetry mongodb automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -51,7 +51,7 @@ }, "devDependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", diff --git a/plugins/node/opentelemetry-instrumentation-mysql/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-mysql/CHANGELOG.md index 3c268dc429..543e160bf3 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-mysql/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mysql-v0.31.2...instrumentation-mysql-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.31.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mysql-v0.31.1...instrumentation-mysql-v0.31.2) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-mysql/package.json b/plugins/node/opentelemetry-instrumentation-mysql/package.json index c0c82662ec..3c281249dd 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-mysql", - "version": "0.31.2", + "version": "0.32.0", "description": "OpenTelemetry mysql automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -48,7 +48,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-mysql2/CHANGELOG.md index b1f5a43f1a..d5050cbd71 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-mysql2/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mysql2-v0.32.1...instrumentation-mysql2-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.32.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mysql2-v0.32.0...instrumentation-mysql2-v0.32.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/package.json b/plugins/node/opentelemetry-instrumentation-mysql2/package.json index 1e34e9a4e5..a9f95f18c9 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql2/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-mysql2", - "version": "0.32.1", + "version": "0.33.0", "description": "OpenTelemetry mysql2 automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -49,7 +49,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "7.0.2", "@types/mysql2": "github:types/mysql2", diff --git a/plugins/node/opentelemetry-instrumentation-nestjs-core/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-nestjs-core/CHANGELOG.md index 2b0f0d7f0f..5f4420dcfe 100644 --- a/plugins/node/opentelemetry-instrumentation-nestjs-core/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-nestjs-core/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-nestjs-core-v0.31.1...instrumentation-nestjs-core-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.31.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-nestjs-core-v0.31.0...instrumentation-nestjs-core-v0.31.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json index 63dc315995..9c49edf48c 100644 --- a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json +++ b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-nestjs-core", - "version": "0.31.1", + "version": "0.32.0", "description": "OpenTelemetry NestJS automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-net/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-net/CHANGELOG.md index 4060311ae8..c35f04aaf1 100644 --- a/plugins/node/opentelemetry-instrumentation-net/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-net/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-net-v0.30.2...instrumentation-net-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.2](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-net-v0.30.1...instrumentation-net-v0.30.2) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-net/package.json b/plugins/node/opentelemetry-instrumentation-net/package.json index c56be973fc..73206bbf26 100644 --- a/plugins/node/opentelemetry-instrumentation-net/package.json +++ b/plugins/node/opentelemetry-instrumentation-net/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-net", - "version": "0.30.2", + "version": "0.31.0", "description": "OpenTelemetry net module automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md index 764a5f21aa..f317244e5d 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pg-v0.32.0...instrumentation-pg-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pg-v0.31.1...instrumentation-pg-v0.32.0) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index 351d5ae02f..917139df6e 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-pg", - "version": "0.32.0", + "version": "0.33.0", "description": "OpenTelemetry postgres automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -55,7 +55,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-pino/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-pino/CHANGELOG.md index d738456a15..275a543673 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-pino/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pino-v0.32.1...instrumentation-pino-v0.33.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.32.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pino-v0.32.0...instrumentation-pino-v0.32.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-pino/package.json b/plugins/node/opentelemetry-instrumentation-pino/package.json index 1a489fab6e..57a72b50ae 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/package.json +++ b/plugins/node/opentelemetry-instrumentation-pino/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-pino", - "version": "0.32.1", + "version": "0.33.0", "description": "OpenTelemetry instrumentation for pino", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md index b288b21d0b..f9386e6b6f 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-4-v0.33.1...instrumentation-redis-4-v0.34.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.33.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-4-v0.33.0...instrumentation-redis-4-v0.33.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/package.json b/plugins/node/opentelemetry-instrumentation-redis-4/package.json index 1bf055252e..08b95f8103 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis-4/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-redis-4", - "version": "0.33.1", + "version": "0.34.0", "description": "Automatic OpenTelemetry instrumentation for redis package version 4", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -54,7 +54,7 @@ "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", "@opentelemetry/core": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md index fa989a01b4..481940fac9 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.33.1...instrumentation-redis-v0.34.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * @opentelemetry/contrib-test-utils bumped from ^0.32.0 to ^0.33.0 + ## [0.33.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.33.0...instrumentation-redis-v0.33.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-redis/package.json b/plugins/node/opentelemetry-instrumentation-redis/package.json index 54dad805eb..0d34a57604 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-redis", - "version": "0.33.1", + "version": "0.34.0", "description": "Automatic OpenTelemetry instrumentation for redis package version 2 and 3", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -54,7 +54,7 @@ "devDependencies": { "@opentelemetry/api": "^1.3.0", "@opentelemetry/context-async-hooks": "^1.8.0", - "@opentelemetry/contrib-test-utils": "^0.32.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", "@opentelemetry/sdk-trace-base": "^1.8.0", "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", diff --git a/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md index a0e51a95a1..0f61989954 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-restify-v0.30.1...instrumentation-restify-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-restify-v0.30.0...instrumentation-restify-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-restify/package.json b/plugins/node/opentelemetry-instrumentation-restify/package.json index 3914f86208..6dc057e31d 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/package.json +++ b/plugins/node/opentelemetry-instrumentation-restify/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-restify", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry restify automatic instrumentation package", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-router/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-router/CHANGELOG.md index cc86698af7..9daa1a7965 100644 --- a/plugins/node/opentelemetry-instrumentation-router/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-router/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-router-v0.31.0...instrumentation-router-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-router-v0.30.0...instrumentation-router-v0.31.0) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-router/package.json b/plugins/node/opentelemetry-instrumentation-router/package.json index 94f47640e4..16298bfefa 100644 --- a/plugins/node/opentelemetry-instrumentation-router/package.json +++ b/plugins/node/opentelemetry-instrumentation-router/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-router", - "version": "0.31.0", + "version": "0.32.0", "description": "OpenTelemetry Router automatic instrumentation package", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-winston/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-winston/CHANGELOG.md index 2348929579..5e66b84296 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-winston/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-winston-v0.30.1...instrumentation-winston-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-winston-v0.30.0...instrumentation-winston-v0.30.1) (2022-11-02) diff --git a/plugins/node/opentelemetry-instrumentation-winston/package.json b/plugins/node/opentelemetry-instrumentation-winston/package.json index 1aa464cb64..5b2e9c805d 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/package.json +++ b/plugins/node/opentelemetry-instrumentation-winston/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-winston", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry instrumentation for winston", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/web/opentelemetry-instrumentation-document-load/CHANGELOG.md b/plugins/web/opentelemetry-instrumentation-document-load/CHANGELOG.md index c75d3484ba..191497e9dc 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/CHANGELOG.md +++ b/plugins/web/opentelemetry-instrumentation-document-load/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-document-load-v0.30.1...instrumentation-document-load-v0.31.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.30.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-document-load-v0.30.0...instrumentation-document-load-v0.30.1) (2022-11-02) diff --git a/plugins/web/opentelemetry-instrumentation-document-load/package.json b/plugins/web/opentelemetry-instrumentation-document-load/package.json index 6c9f8913db..85cc18e7b2 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/package.json +++ b/plugins/web/opentelemetry-instrumentation-document-load/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-document-load", - "version": "0.30.1", + "version": "0.31.0", "description": "OpenTelemetry document-load automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/plugins/web/opentelemetry-instrumentation-long-task/CHANGELOG.md b/plugins/web/opentelemetry-instrumentation-long-task/CHANGELOG.md index 8f52c81812..89db157592 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/CHANGELOG.md +++ b/plugins/web/opentelemetry-instrumentation-long-task/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-long-task-v0.31.1...instrumentation-long-task-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.31.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-long-task-v0.31.0...instrumentation-long-task-v0.31.1) (2022-11-02) diff --git a/plugins/web/opentelemetry-instrumentation-long-task/package.json b/plugins/web/opentelemetry-instrumentation-long-task/package.json index 101e47457f..aa03cfaca6 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/package.json +++ b/plugins/web/opentelemetry-instrumentation-long-task/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-long-task", - "version": "0.31.1", + "version": "0.32.0", "description": "OpenTelemetry long task API automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/CHANGELOG.md b/plugins/web/opentelemetry-instrumentation-user-interaction/CHANGELOG.md index 780a590647..00b9ee8df3 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/CHANGELOG.md +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-user-interaction-v0.31.1...instrumentation-user-interaction-v0.32.0) (2022-11-16) + + +### Features + +* update experimental deps to `^0.34.0`, core deps to `^1.8.0`, api to `^1.3.0` ([#1278](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1278)) ([e9fe8e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/e9fe8e13e34f54e96c50525cadeb74ac048c5624)) + ## [0.31.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-user-interaction-v0.31.0...instrumentation-user-interaction-v0.31.1) (2022-11-02) diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json index 9350a877de..6c5fd3d299 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-user-interaction", - "version": "0.31.1", + "version": "0.32.0", "description": "OpenTelemetry UserInteraction automatic instrumentation package.", "main": "build/src/index.js", "module": "build/esm/index.js", From f865143d9042c41ebed6adbe906097ad7622f2c7 Mon Sep 17 00:00:00 2001 From: Motti Bechhofer Date: Tue, 22 Nov 2022 12:58:02 +0200 Subject: [PATCH 06/91] feat: add socket.io instrumentation (#1284) --- .github/component_owners.yml | 3 + .release-please-manifest.json | 2 +- .../auto-instrumentations-node/README.md | 1 + .../auto-instrumentations-node/package.json | 1 + .../auto-instrumentations-node/src/utils.ts | 2 + .../instrumentation-socket.io/.eslintignore | 1 + .../instrumentation-socket.io/.eslintrc.js | 7 + .../node/instrumentation-socket.io/.npmignore | 4 + .../node/instrumentation-socket.io/.tav.yml | 15 + .../node/instrumentation-socket.io/LICENSE | 201 ++++++++ .../node/instrumentation-socket.io/README.md | 76 +++ .../instrumentation-socket.io/package.json | 66 +++ .../src/AttributeNames.ts | 20 + .../instrumentation-socket.io/src/index.ts | 18 + .../src/socket.io.ts | 450 ++++++++++++++++++ .../instrumentation-socket.io/src/types.ts | 40 ++ .../instrumentation-socket.io/src/utils.ts | 49 ++ .../test/config.test.ts | 32 ++ .../test/socket.io.test.ts | 449 +++++++++++++++++ .../instrumentation-socket.io/test/utils.ts | 75 +++ .../instrumentation-socket.io/tsconfig.json | 11 + release-please-config.json | 1 + 22 files changed, 1523 insertions(+), 1 deletion(-) create mode 100644 plugins/node/instrumentation-socket.io/.eslintignore create mode 100644 plugins/node/instrumentation-socket.io/.eslintrc.js create mode 100644 plugins/node/instrumentation-socket.io/.npmignore create mode 100644 plugins/node/instrumentation-socket.io/.tav.yml create mode 100644 plugins/node/instrumentation-socket.io/LICENSE create mode 100644 plugins/node/instrumentation-socket.io/README.md create mode 100644 plugins/node/instrumentation-socket.io/package.json create mode 100644 plugins/node/instrumentation-socket.io/src/AttributeNames.ts create mode 100644 plugins/node/instrumentation-socket.io/src/index.ts create mode 100644 plugins/node/instrumentation-socket.io/src/socket.io.ts create mode 100644 plugins/node/instrumentation-socket.io/src/types.ts create mode 100644 plugins/node/instrumentation-socket.io/src/utils.ts create mode 100644 plugins/node/instrumentation-socket.io/test/config.test.ts create mode 100644 plugins/node/instrumentation-socket.io/test/socket.io.test.ts create mode 100644 plugins/node/instrumentation-socket.io/test/utils.ts create mode 100644 plugins/node/instrumentation-socket.io/tsconfig.json diff --git a/.github/component_owners.yml b/.github/component_owners.yml index 033888085b..acc7575d3a 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -56,6 +56,9 @@ components: - rauno56 plugins/node/opentelemetry-instrumentation-pg: - rauno56 + plugins/node/opentelemetry-instrumentation-socket.io: + - mottibec + - rauno56 plugins/web/opentelemetry-instrumentation-document-load: - obecny plugins/web/opentelemetry-instrumentation-long-task: diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3abf9b2078..e41db53c94 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,2 +1,2 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0", "plugins/node/instrumentation-socket.io": "0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} diff --git a/metapackages/auto-instrumentations-node/README.md b/metapackages/auto-instrumentations-node/README.md index 21b7c9c8d3..95ab8cff0a 100644 --- a/metapackages/auto-instrumentations-node/README.md +++ b/metapackages/auto-instrumentations-node/README.md @@ -88,6 +88,7 @@ registerInstrumentations({ - [@opentelemetry/instrumentation-pino](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pino) - [@opentelemetry/instrumentation-redis](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis) - [@opentelemetry/instrumentation-restify](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-restify) +- [@opentelemetry/instrumentation-socket.io](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-socket.io) - [@opentelemetry/instrumentation-winston](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-winston) ## Useful links diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index 255857d49a..5ad4e86a17 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -80,6 +80,7 @@ "@opentelemetry/instrumentation-redis-4": "^0.34.0", "@opentelemetry/instrumentation-restify": "^0.31.0", "@opentelemetry/instrumentation-router": "^0.32.0", + "@opentelemetry/instrumentation-socket.io": "^0.32.0", "@opentelemetry/instrumentation-tedious": "^0.5.0", "@opentelemetry/instrumentation-winston": "^0.31.0" } diff --git a/metapackages/auto-instrumentations-node/src/utils.ts b/metapackages/auto-instrumentations-node/src/utils.ts index 2daba2146d..dfb7a511a4 100644 --- a/metapackages/auto-instrumentations-node/src/utils.ts +++ b/metapackages/auto-instrumentations-node/src/utils.ts @@ -50,6 +50,7 @@ import { RedisInstrumentation as RedisInstrumentationV2 } from '@opentelemetry/i import { RedisInstrumentation as RedisInstrumentationV4 } from '@opentelemetry/instrumentation-redis-4'; import { RestifyInstrumentation } from '@opentelemetry/instrumentation-restify'; import { RouterInstrumentation } from '@opentelemetry/instrumentation-router'; +import { SocketIoInstrumentation } from '@opentelemetry/instrumentation-socket.io'; import { TediousInstrumentation } from '@opentelemetry/instrumentation-tedious'; import { WinstonInstrumentation } from '@opentelemetry/instrumentation-winston'; @@ -88,6 +89,7 @@ const InstrumentationMap = { '@opentelemetry/instrumentation-redis-4': RedisInstrumentationV4, '@opentelemetry/instrumentation-restify': RestifyInstrumentation, '@opentelemetry/instrumentation-router': RouterInstrumentation, + '@opentelemetry/instrumentation-socket.io': SocketIoInstrumentation, '@opentelemetry/instrumentation-tedious': TediousInstrumentation, '@opentelemetry/instrumentation-winston': WinstonInstrumentation, }; diff --git a/plugins/node/instrumentation-socket.io/.eslintignore b/plugins/node/instrumentation-socket.io/.eslintignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/.eslintignore @@ -0,0 +1 @@ +build diff --git a/plugins/node/instrumentation-socket.io/.eslintrc.js b/plugins/node/instrumentation-socket.io/.eslintrc.js new file mode 100644 index 0000000000..f756f4488b --- /dev/null +++ b/plugins/node/instrumentation-socket.io/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + "env": { + "mocha": true, + "node": true + }, + ...require('../../../eslint.config.js') +} diff --git a/plugins/node/instrumentation-socket.io/.npmignore b/plugins/node/instrumentation-socket.io/.npmignore new file mode 100644 index 0000000000..9505ba9450 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/.npmignore @@ -0,0 +1,4 @@ +/bin +/coverage +/doc +/test diff --git a/plugins/node/instrumentation-socket.io/.tav.yml b/plugins/node/instrumentation-socket.io/.tav.yml new file mode 100644 index 0000000000..2c704e4634 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/.tav.yml @@ -0,0 +1,15 @@ +'socket.io': + - versions: "2.1.1 || 2.2.0 || 2.3.0 || 2.4.0 || ^2.5.0" + peerDependencies: socket.io-client@^2 + commands: + - npm run test + + - versions: "^3.1.3" + peerDependencies: socket.io-client@^3 + commands: + - npm run test + + - versions: "4.4.1 || 4.5.1 || 4.5.2 || ^4.5.3" + peerDependencies: socket.io-client@^4 + commands: + - npm run test diff --git a/plugins/node/instrumentation-socket.io/LICENSE b/plugins/node/instrumentation-socket.io/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/plugins/node/instrumentation-socket.io/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 [yyyy] [name of copyright owner] + + 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/plugins/node/instrumentation-socket.io/README.md b/plugins/node/instrumentation-socket.io/README.md new file mode 100644 index 0000000000..ca242046f9 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/README.md @@ -0,0 +1,76 @@ +# OpenTelemetry socket.io Instrumentation for Node.js + +[![NPM Published Version][npm-img]][npm-url] +[![Apache License][license-image]][license-image] + +This module provides automatic instrumentation for the [`socket.io`](https://github.com/socketio/socket.io) 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. + +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. + +Compatible with OpenTelemetry JS API and SDK `1.0+`. + +## Installation + +```bash +npm install --save @opentelemetry/instrumentation-socket.io +``` + +## Supported Versions + +- `>=2 <5` + +## Usage + +To load a specific plugin, specify it in the registerInstrumentations's configuration: + +```js +const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node"); +const { + SocketIoInstrumentation, +} = require("@opentelemetry/instrumentation-socket.io"); +const { registerInstrumentations } = require("@opentelemetry/instrumentation"); + +const provider = new NodeTracerProvider(); +provider.register(); + +registerInstrumentations({ + instrumentations: [new SocketIoInstrumentation()], +}); +``` + +## Optional Parameters + +| Option | Type | Default | Description | +| ------ | ---- | ------- | ----------- | +| `emitHook` | `SocketIoHookFunction` | `undefined` | hook for adding custom attributes before socket.io emits the event | +| `emitIgnoreEventList` | `string[]` | `[]` | names of emitted events to ignore tracing for | +| `onHook` | `SocketIoHookFunction` | `undefined` | hook for adding custom attributes before the event listener (callback) is invoked | +| `onIgnoreEventList` | `string[]` | `[]` | names of listened events to ignore tracing for | +| `traceReserved` | `boolean` | `false` | set to true if you want to trace socket.io reserved events (see [docs](https://socket.io/docs/v4/emit-cheatsheet/#Reserved-events)) | + +## Migration From opentelemetry-instrumentation-socket.io + +This instrumentation was originally published and maintained under the name `"opentelemetry-instrumentation-socket.io"` in [this repo](https://github.com/aspecto-io/opentelemetry-ext-js). + +Few breaking changes were made during porting to the contrib repo: + +### filterHttpTransport + +The instrumentation's config `filterHttpTransport` option was removed to decouple this instrumentation from the http instrumentation. +if you do not want to trace the socket.io http requests, add the default socket.io route (`/socket.io/`) to the `HttpInstrumentationConfig.ignoreIncomingPaths` array + +## 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/instrumentation-socket.io +[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Finstrumentation-socket.io.svg diff --git a/plugins/node/instrumentation-socket.io/package.json b/plugins/node/instrumentation-socket.io/package.json new file mode 100644 index 0000000000..f6b1191099 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/package.json @@ -0,0 +1,66 @@ +{ + "name": "@opentelemetry/instrumentation-socket.io", + "version": "0.32.0", + "description": "OpenTelemetry automatic instrumentation package for socket.io", + "main": "build/src/index.js", + "types": "build/src/index.d.ts", + "repository": "open-telemetry/opentelemetry-js-contrib", + "scripts": { + "test": "ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", + "test-all-versions": "tav", + "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 --scope @opentelemetry/instrumentation-socket.io --include-dependencies", + "prewatch": "npm run precompile", + "prepare": "npm run compile", + "version:update": "node ../../../scripts/version-update.js", + "compile": "npm run version:update && tsc -p ." + }, + "keywords": [ + "socket.io", + "instrumentation", + "nodejs", + "opentelemetry", + "tracing" + ], + "author": "OpenTelemetry Authors", + "license": "Apache-2.0", + "engines": { + "node": ">=14.0" + }, + "files": [ + "build/src/**/*.js", + "build/src/**/*.js.map", + "build/src/**/*.d.ts" + ], + "publishConfig": { + "access": "public" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + }, + "devDependencies": { + "@opentelemetry/api": "^1.3.0", + "@opentelemetry/contrib-test-utils": "^0.33.0", + "@opentelemetry/sdk-trace-base": "^1.8.0", + "@types/mocha": "8.2.3", + "@types/node": "18.11.7", + "expect": "27.4.2", + "gts": "3.1.0", + "mocha": "7.2.0", + "nyc": "15.1.0", + "rimraf": "3.0.2", + "socket.io": "^4.1.3", + "socket.io-client": "^4.1.3", + "test-all-versions": "5.0.1", + "ts-mocha": "10.0.0", + "typescript": "4.3.5" + }, + "dependencies": { + "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/semantic-conventions": "^1.0.0" + }, + "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/instrumentation-socket.io#readme" +} diff --git a/plugins/node/instrumentation-socket.io/src/AttributeNames.ts b/plugins/node/instrumentation-socket.io/src/AttributeNames.ts new file mode 100644 index 0000000000..ce46246b25 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/src/AttributeNames.ts @@ -0,0 +1,20 @@ +/* + * 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 const SocketIoInstrumentationAttributes = { + SOCKET_IO_ROOMS: 'messaging.socket.io.rooms', + SOCKET_IO_NAMESPACE: 'messaging.socket.io.namespace', + SOCKET_IO_EVENT_NAME: 'messaging.socket.io.event_name', +}; diff --git a/plugins/node/instrumentation-socket.io/src/index.ts b/plugins/node/instrumentation-socket.io/src/index.ts new file mode 100644 index 0000000000..c32b37405f --- /dev/null +++ b/plugins/node/instrumentation-socket.io/src/index.ts @@ -0,0 +1,18 @@ +/* + * 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 * from './socket.io'; +export * from './types'; +export * from './AttributeNames'; diff --git a/plugins/node/instrumentation-socket.io/src/socket.io.ts b/plugins/node/instrumentation-socket.io/src/socket.io.ts new file mode 100644 index 0000000000..db37e5c375 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/src/socket.io.ts @@ -0,0 +1,450 @@ +/* + * 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 { + context, + trace, + Span, + SpanKind, + SpanStatusCode, +} from '@opentelemetry/api'; +import { + InstrumentationBase, + InstrumentationNodeModuleFile, + InstrumentationNodeModuleDefinition, + isWrapped, + safeExecuteInTheMiddle, +} from '@opentelemetry/instrumentation'; +import { + SemanticAttributes, + MessagingOperationValues, + MessagingDestinationKindValues, +} from '@opentelemetry/semantic-conventions'; +import { SocketIoInstrumentationConfig } from './types'; +import { SocketIoInstrumentationAttributes } from './AttributeNames'; +import { VERSION } from './version'; +import { + extractRoomsAttributeValue, + isPromise, + normalizeConfig, +} from './utils'; + +const reservedEvents = [ + 'connect', + 'connect_error', + 'disconnect', + 'disconnecting', + 'newListener', + 'removeListener', +]; + +export class SocketIoInstrumentation extends InstrumentationBase { + protected override _config!: SocketIoInstrumentationConfig; + + constructor(config: SocketIoInstrumentationConfig = {}) { + super( + '@opentelemetry/instrumentation-socket.io', + VERSION, + normalizeConfig(config) + ); + } + + protected init() { + const socketInstrumentation = new InstrumentationNodeModuleFile( + 'socket.io/dist/socket.js', + ['>=3 <5'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug(`applying patch to socket.io@${moduleVersion} Socket`); + if (isWrapped(moduleExports?.Socket?.prototype?.on)) { + this._unwrap(moduleExports.Socket.prototype, 'on'); + } + this._wrap( + moduleExports.Socket.prototype, + 'on', + this._patchOn(moduleVersion) + ); + if (isWrapped(moduleExports?.Socket?.prototype?.emit)) { + this._unwrap(moduleExports.Socket.prototype, 'emit'); + } + this._wrap( + moduleExports.Socket.prototype, + 'emit', + this._patchEmit(moduleVersion) + ); + return moduleExports; + }, + moduleExports => { + if (isWrapped(moduleExports?.Socket?.prototype?.on)) { + this._unwrap(moduleExports.Socket.prototype, 'on'); + } + if (isWrapped(moduleExports?.Socket?.prototype?.emit)) { + this._unwrap(moduleExports.Socket.prototype, 'emit'); + } + return moduleExports; + } + ); + + const broadcastOperatorInstrumentation = + new InstrumentationNodeModuleFile( + 'socket.io/dist/broadcast-operator.js', + ['>=4 <5'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug( + `applying patch to socket.io@${moduleVersion} StrictEventEmitter` + ); + if (isWrapped(moduleExports?.BroadcastOperator?.prototype?.emit)) { + this._unwrap(moduleExports.BroadcastOperator.prototype, 'emit'); + } + this._wrap( + moduleExports.BroadcastOperator.prototype, + 'emit', + this._patchEmit(moduleVersion) + ); + return moduleExports; + }, + moduleExports => { + if (isWrapped(moduleExports?.BroadcastOperator?.prototype?.emit)) { + this._unwrap(moduleExports.BroadcastOperator.prototype, 'emit'); + } + return moduleExports; + } + ); + const namespaceInstrumentation = new InstrumentationNodeModuleFile( + 'socket.io/dist/namespace.js', + ['<4'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug( + `applying patch to socket.io@${moduleVersion} Namespace` + ); + if (isWrapped(moduleExports?.Namespace?.prototype?.emit)) { + this._unwrap(moduleExports.Namespace.prototype, 'emit'); + } + this._wrap( + moduleExports.Namespace.prototype, + 'emit', + this._patchEmit(moduleVersion) + ); + return moduleExports; + }, + moduleExports => { + if (isWrapped(moduleExports?.Namespace?.prototype?.emit)) { + this._unwrap(moduleExports.Namespace.prototype, 'emit'); + } + } + ); + const socketInstrumentationLegacy = new InstrumentationNodeModuleFile( + 'socket.io/lib/socket.js', + ['2'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug(`applying patch to socket.io@${moduleVersion} Socket`); + if (isWrapped(moduleExports.prototype?.on)) { + this._unwrap(moduleExports.prototype, 'on'); + } + this._wrap(moduleExports.prototype, 'on', this._patchOn(moduleVersion)); + if (isWrapped(moduleExports.prototype?.emit)) { + this._unwrap(moduleExports.prototype, 'emit'); + } + this._wrap( + moduleExports.prototype, + 'emit', + this._patchEmit(moduleVersion) + ); + return moduleExports; + }, + moduleExports => { + if (isWrapped(moduleExports.prototype?.on)) { + this._unwrap(moduleExports.prototype, 'on'); + } + if (isWrapped(moduleExports.prototype?.emit)) { + this._unwrap(moduleExports.prototype, 'emit'); + } + return moduleExports; + } + ); + const namespaceInstrumentationLegacy = + new InstrumentationNodeModuleFile( + 'socket.io/lib/namespace.js', + ['2'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug( + `applying patch to socket.io@${moduleVersion} Namespace` + ); + if (isWrapped(moduleExports?.prototype?.emit)) { + this._unwrap(moduleExports.prototype, 'emit'); + } + this._wrap( + moduleExports.prototype, + 'emit', + this._patchEmit(moduleVersion) + ); + return moduleExports; + }, + moduleExports => { + if (isWrapped(moduleExports?.prototype?.emit)) { + this._unwrap(moduleExports.prototype, 'emit'); + } + } + ); + + return [ + new InstrumentationNodeModuleDefinition( + 'socket.io', + ['>=3 <5'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug( + `applying patch to socket.io@${moduleVersion} Server` + ); + if (isWrapped(moduleExports?.Server?.prototype?.on)) { + this._unwrap(moduleExports.Server.prototype, 'on'); + } + this._wrap( + moduleExports.Server.prototype, + 'on', + this._patchOn(moduleVersion) + ); + return moduleExports; + }, + (moduleExports, moduleVersion) => { + if (isWrapped(moduleExports?.Server?.prototype?.on)) { + this._unwrap(moduleExports.Server.prototype, 'on'); + } + return moduleExports; + }, + [ + broadcastOperatorInstrumentation, + namespaceInstrumentation, + socketInstrumentation, + ] + ), + new InstrumentationNodeModuleDefinition( + 'socket.io', + ['2'], + (moduleExports, moduleVersion) => { + if (moduleExports === undefined || moduleExports === null) { + return moduleExports; + } + if (moduleVersion === undefined) { + return moduleExports; + } + this._diag.debug( + `applying patch to socket.io@${moduleVersion} Server` + ); + if (isWrapped(moduleExports?.prototype?.on)) { + this._unwrap(moduleExports.prototype, 'on'); + } + this._wrap( + moduleExports.prototype, + 'on', + this._patchOn(moduleVersion) + ); + return moduleExports; + }, + (moduleExports, moduleVersion) => { + if (isWrapped(moduleExports?.prototype?.on)) { + this._unwrap(moduleExports.prototype, 'on'); + } + return moduleExports; + }, + [namespaceInstrumentationLegacy, socketInstrumentationLegacy] + ), + ]; + } + + override setConfig(config: SocketIoInstrumentationConfig = {}) { + return super.setConfig(normalizeConfig(config)); + } + + private _patchOn(moduleVersion: string) { + const self = this; + return (original: Function) => { + return function (this: any, ev: any, originalListener: Function) { + if (!self._config.traceReserved && reservedEvents.includes(ev)) { + return original.apply(this, arguments); + } + if (self._config.onIgnoreEventList?.includes(ev)) { + return original.apply(this, arguments); + } + const wrappedListener = function (this: any, ...args: any[]) { + const eventName = ev; + const defaultNamespace = '/'; + const namespace = this.name || this.adapter?.nsp?.name; + const destination = + namespace === defaultNamespace + ? eventName + : `${namespace} ${eventName}`; + const span: Span = self.tracer.startSpan( + `${destination} ${MessagingOperationValues.RECEIVE}`, + { + kind: SpanKind.CONSUMER, + attributes: { + [SemanticAttributes.MESSAGING_SYSTEM]: 'socket.io', + [SemanticAttributes.MESSAGING_DESTINATION]: namespace, + [SemanticAttributes.MESSAGING_OPERATION]: + MessagingOperationValues.RECEIVE, + [SocketIoInstrumentationAttributes.SOCKET_IO_EVENT_NAME]: + eventName, + }, + } + ); + + if (self._config.onHook) { + safeExecuteInTheMiddle( + () => + self._config?.onHook?.(span, { moduleVersion, payload: args }), + e => { + if (e) self._diag.error('onHook error', e); + }, + true + ); + } + return context.with(trace.setSpan(context.active(), span), () => + self.endSpan(() => originalListener.apply(this, arguments), span) + ); + }; + return original.apply(this, [ev, wrappedListener]); + }; + }; + } + + private endSpan(traced: () => any | Promise, span: Span) { + try { + const result = traced(); + if (isPromise(result)) { + return result.then( + value => { + span.end(); + return value; + }, + err => { + span.recordException(err); + span.setStatus({ + code: SpanStatusCode.ERROR, + message: err?.message, + }); + span.end(); + throw err; + } + ); + } else { + span.end(); + return result; + } + } catch (error: any) { + span.recordException(error); + span.setStatus({ code: SpanStatusCode.ERROR, message: error?.message }); + span.end(); + throw error; + } + } + + private _patchEmit(moduleVersion: string) { + const self = this; + return (original: Function) => { + return function (this: any, ev: any, ...args: any[]) { + if (!self._config.traceReserved && reservedEvents.includes(ev)) { + return original.apply(this, arguments); + } + if (self._config?.emitIgnoreEventList?.includes(ev)) { + return original.apply(this, arguments); + } + const messagingSystem = 'socket.io'; + const eventName = ev; + const attributes: any = { + [SemanticAttributes.MESSAGING_SYSTEM]: messagingSystem, + [SemanticAttributes.MESSAGING_DESTINATION_KIND]: + MessagingDestinationKindValues.TOPIC, + [SocketIoInstrumentationAttributes.SOCKET_IO_EVENT_NAME]: eventName, + }; + + const rooms = extractRoomsAttributeValue(this); + if (rooms.length) { + attributes[SocketIoInstrumentationAttributes.SOCKET_IO_ROOMS] = rooms; + } + const namespace = + this.name || this.adapter?.nsp?.name || this.sockets?.name; + if (namespace) { + attributes[SocketIoInstrumentationAttributes.SOCKET_IO_NAMESPACE] = + namespace; + attributes[SemanticAttributes.MESSAGING_DESTINATION] = namespace; + } + const spanRooms = rooms.length ? `[${rooms.join()}]` : ''; + const span = self.tracer.startSpan(`${namespace}${spanRooms} send`, { + kind: SpanKind.PRODUCER, + attributes, + }); + + if (self._config.emitHook) { + safeExecuteInTheMiddle( + () => + self._config.emitHook?.(span, { moduleVersion, payload: args }), + e => { + if (e) self._diag.error('emitHook error', e); + }, + true + ); + } + try { + return context.with(trace.setSpan(context.active(), span), () => + original.apply(this, arguments) + ); + } catch (error: any) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: error.message, + }); + throw error; + } finally { + span.end(); + } + }; + }; + } +} diff --git a/plugins/node/instrumentation-socket.io/src/types.ts b/plugins/node/instrumentation-socket.io/src/types.ts new file mode 100644 index 0000000000..ec432e0566 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/src/types.ts @@ -0,0 +1,40 @@ +/* + * 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 { Span } from '@opentelemetry/api'; +import { InstrumentationConfig } from '@opentelemetry/instrumentation'; + +export const defaultSocketIoPath = '/socket.io/'; + +export interface SocketIoHookInfo { + moduleVersion?: string; + payload: any[]; +} +export interface SocketIoHookFunction { + (span: Span, hookInfo: SocketIoHookInfo): void; +} + +export interface SocketIoInstrumentationConfig extends InstrumentationConfig { + /** Hook for adding custom attributes before socket.io emits the event */ + emitHook?: SocketIoHookFunction; + /** list of events to ignore tracing on for socket.io emits */ + emitIgnoreEventList?: string[]; + /** Hook for adding custom attributes before the event listener (callback) is invoked */ + onHook?: SocketIoHookFunction; + /** list of events to ignore tracing on for socket.io listeners */ + onIgnoreEventList?: string[]; + /** Set to `true` if you want to trace socket.io reserved events (see https://socket.io/docs/v4/emit-cheatsheet/#Reserved-events) */ + traceReserved?: boolean; +} diff --git a/plugins/node/instrumentation-socket.io/src/utils.ts b/plugins/node/instrumentation-socket.io/src/utils.ts new file mode 100644 index 0000000000..a4ace3a485 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/src/utils.ts @@ -0,0 +1,49 @@ +/* + * 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 { SocketIoInstrumentationConfig } from './types'; + +export const isPromise = (value: any): value is Promise => { + return typeof value?.then === 'function'; +}; + +export const normalizeConfig = (config?: SocketIoInstrumentationConfig) => { + config = Object.assign({}, config); + if (!Array.isArray(config.emitIgnoreEventList)) { + config.emitIgnoreEventList = []; + } + if (!Array.isArray(config.onIgnoreEventList)) { + config.onIgnoreEventList = []; + } + return config; +}; + +export const extractRoomsAttributeValue = (self: any): any[] => { + let rooms = + self.rooms || + self._rooms || + self.sockets?._rooms || + self.sockets?.rooms || + []; + // Some of the attributes above are of Set type. Convert it. + if (!Array.isArray(rooms)) { + rooms = Array.from(rooms); + } + // only for v2: this.id is only set for v2. That's to mimic later versions which have this.id in the rooms Set. + if (rooms.length === 0 && self.id) { + rooms.push(self.id); + } + return rooms; +}; diff --git a/plugins/node/instrumentation-socket.io/test/config.test.ts b/plugins/node/instrumentation-socket.io/test/config.test.ts new file mode 100644 index 0000000000..de1b89c7ac --- /dev/null +++ b/plugins/node/instrumentation-socket.io/test/config.test.ts @@ -0,0 +1,32 @@ +/* + * 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 { SocketIoInstrumentation, SocketIoInstrumentationConfig } from '../src'; +import * as expect from 'expect'; + +describe('SocketIoInstrumentationConfig', () => { + it('forces *IgnoreEventList to be an Array', () => { + const socketIoInstrumentation = new SocketIoInstrumentation({ + onIgnoreEventList: {} as any, + emitIgnoreEventList: 1 as any, + }); + + const { onIgnoreEventList, emitIgnoreEventList } = + socketIoInstrumentation.getConfig() as SocketIoInstrumentationConfig; + + expect(Array.isArray(onIgnoreEventList)).toEqual(true); + expect(Array.isArray(emitIgnoreEventList)).toEqual(true); + }); +}); diff --git a/plugins/node/instrumentation-socket.io/test/socket.io.test.ts b/plugins/node/instrumentation-socket.io/test/socket.io.test.ts new file mode 100644 index 0000000000..1b47fd5d73 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/test/socket.io.test.ts @@ -0,0 +1,449 @@ +/* + * 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 { + MessagingDestinationKindValues, + SemanticAttributes, +} from '@opentelemetry/semantic-conventions'; +import { + SocketIoInstrumentation, + SocketIoInstrumentationAttributes, + SocketIoInstrumentationConfig, +} from '../src'; +import { SpanKind, SpanStatusCode } from '@opentelemetry/api'; +import * as expect from 'expect'; +import 'mocha'; +import { registerInstrumentationTesting } from '@opentelemetry/contrib-test-utils'; + +const instrumentation = registerInstrumentationTesting( + new SocketIoInstrumentation() +); +import { Socket } from 'socket.io'; +import { + createServer, + createServerInstance, + io, + getSocketIoSpans, + expectSpan, + isV2, +} from './utils'; + +describe('SocketIoInstrumentation', () => { + beforeEach(() => { + instrumentation.enable(); + instrumentation.setConfig({}); + }); + + afterEach(() => { + instrumentation.disable(); + }); + + describe('Server', () => { + it('emit is instrumented', () => { + const io = createServerInstance(); + io.emit('test'); + expectSpan('/ send', span => { + expect(span.kind).toEqual(SpanKind.PRODUCER); + expect(span.attributes[SemanticAttributes.MESSAGING_SYSTEM]).toEqual( + 'socket.io' + ); + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION_KIND] + ).toEqual(MessagingDestinationKindValues.TOPIC); + }); + }); + + it('emitIgnoreEventList events are ignored', () => { + const io = createServerInstance(); + const config: SocketIoInstrumentationConfig = { + emitIgnoreEventList: ['ignored'], + }; + instrumentation.setConfig(config); + io.emit('test'); + io.emit('ignored'); + expect(getSocketIoSpans().length).toEqual(1); + }); + + it('emit reserved events error is instrumented', () => { + const config: SocketIoInstrumentationConfig = { + traceReserved: true, + }; + instrumentation.setConfig(config); + const io = createServerInstance(); + try { + io.emit('connect'); + } catch (error) {} + if (isV2) { + // only for v2: connect do not throw, but are just ignored + return expectSpan('/ send', span => { + expect(span.kind).toEqual(SpanKind.PRODUCER); + expect(span.attributes[SemanticAttributes.MESSAGING_SYSTEM]).toEqual( + 'socket.io' + ); + }); + } + expectSpan('/ send', span => { + expect(span.status.code).toEqual(SpanStatusCode.ERROR); + expect(span.status.message).toEqual( + '"connect" is a reserved event name' + ); + }); + }); + + it('send is instrumented', () => { + const io = createServerInstance(); + io.send('test'); + expectSpan('/ send', span => { + expect(span.kind).toEqual(SpanKind.PRODUCER); + expect(span.attributes[SemanticAttributes.MESSAGING_SYSTEM]).toEqual( + 'socket.io' + ); + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION_KIND] + ).toEqual(MessagingDestinationKindValues.TOPIC); + }); + }); + + it('emitHook is called', () => { + const config: SocketIoInstrumentationConfig = { + traceReserved: true, + emitHook: (span, hookInfo) => { + span.setAttribute('payload', JSON.stringify(hookInfo.payload)); + }, + }; + instrumentation.setConfig(config); + + const io = createServerInstance(); + io.emit('test', 1234); + expectSpan('/ send', span => { + expect(span.attributes['payload']).toEqual(JSON.stringify([1234])); + }); + }); + + it('emitHook error does not effect trace', () => { + const config: SocketIoInstrumentationConfig = { + emitHook: () => { + throw new Error('Throwing'); + }, + }; + instrumentation.setConfig(config); + const io = createServerInstance(); + io.emit('test'); + const spans = getSocketIoSpans(); + expect(spans.length).toBe(1); + }); + + it('onHook is called', done => { + const config: SocketIoInstrumentationConfig = { + onHook: (span, hookInfo) => { + span.setAttribute('payload', JSON.stringify(hookInfo.payload)); + }, + // only for v2: v2 emits connection on the client side, newer versions do not + emitIgnoreEventList: ['connection'], + }; + instrumentation.setConfig(config); + const data = { + name: 'bob', + age: 28, + }; + createServer((sio, port) => { + const client = io(`http://localhost:${port}`); + client.on('test', () => client.emit('test_reply', data)); + sio.on('connection', (socket: Socket) => { + socket.emit('test'); + socket.on('test_reply', data => { + client.close(); + sio.close(); + //trace is created after the listener method is completed + setTimeout(() => { + expectSpan( + 'test_reply receive', + span => { + try { + expect(span.kind).toEqual(SpanKind.CONSUMER); + expect( + span.attributes[SemanticAttributes.MESSAGING_SYSTEM] + ).toEqual('socket.io'); + expect(span.attributes['payload']).toEqual( + JSON.stringify([data]) + ); + done(); + } catch (e) { + done(e); + } + }, + 3 + ); + }); + }); + }); + }); + }); + + it('traceReserved:true on is instrumented', done => { + const config: SocketIoInstrumentationConfig = { + traceReserved: true, + // only for v2: v2 emits [dis]connect[ing] events which later versions do not + emitIgnoreEventList: [ + 'disconnect', + 'disconnecting', + 'connection', + 'connect', + ], + }; + instrumentation.setConfig(config); + createServer((sio, port) => { + const client = io(`http://localhost:${port}`); + sio.on('connection', () => { + client.close(); + sio.close(); + //trace is created after the listener method is completed + setTimeout(() => { + expectSpan('connection receive', span => { + expect(span.kind).toEqual(SpanKind.CONSUMER); + expect( + span.attributes[SemanticAttributes.MESSAGING_SYSTEM] + ).toEqual('socket.io'); + done(); + }); + }); + }); + }); + }); + + it('on is instrumented', done => { + const config: SocketIoInstrumentationConfig = { + // only for v2: v2 emits connection events which later versions do not + emitIgnoreEventList: ['connection'], + }; + instrumentation.setConfig(config); + createServer((sio, port) => { + const client = io(`http://localhost:${port}`); + client.on('test', () => client.emit('test_reply')); + sio.on('connection', (socket: Socket) => { + socket.emit('test'); + socket.on('test_reply', () => { + client.close(); + sio.close(); + //trace is created after the listener method is completed + setTimeout(() => { + expectSpan( + 'test_reply receive', + span => { + try { + expect(span.kind).toEqual(SpanKind.CONSUMER); + expect( + span.attributes[SemanticAttributes.MESSAGING_SYSTEM] + ).toEqual('socket.io'); + done(); + } catch (e) { + done(e); + } + }, + 3 + ); + }); + }); + }); + }); + }); + + it('onIgnoreEventList events are ignored', done => { + const config: SocketIoInstrumentationConfig = { + onIgnoreEventList: ['test_reply'], + // only for v2: v2 emits connection events which later versions do not + emitIgnoreEventList: ['connection'], + }; + instrumentation.setConfig(config); + createServer((sio, port) => { + const client = io(`http://localhost:${port}`); + client.on('test', () => client.emit('test_reply')); + sio.on('connection', (socket: Socket) => { + socket.emit('test'); + socket.on('test_reply', () => { + client.close(); + sio.close(); + //trace is created after the listener method is completed + setTimeout(() => { + try { + expect(getSocketIoSpans().length).toEqual(2); + done(); + } catch (e) { + done(e); + } + }); + }); + }); + }); + }); + + it('broadcast is instrumented', () => { + const roomName = 'room'; + const sio = createServerInstance(); + sio.to(roomName).emit('broadcast', '1234'); + expectSpan('/[room] send', span => { + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_ROOMS] + ).toEqual([roomName]); + }); + }); + + it('broadcast to multiple rooms', () => { + const sio = createServerInstance(); + sio.to('room1').to('room2').emit('broadcast', '1234'); + expectSpan('/[room1,room2] send', span => { + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_ROOMS] + ).toEqual(['room1', 'room2']); + }); + }); + }); + + describe('Namespace', () => { + it('emit is instrumented', () => { + const io = createServerInstance(); + const namespace = io.of('/testing'); + namespace.emit('namespace'); + expectSpan('/testing send', span => { + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/testing'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_NAMESPACE] + ).toEqual('/testing'); + }); + }); + + it('broadcast is instrumented', () => { + const roomName = 'room'; + const io = createServerInstance(); + const namespace = io.of('/testing'); + namespace.to(roomName).emit('broadcast', '1234'); + expectSpan('/testing[room] send', span => { + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/testing'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_ROOMS] + ).toEqual([roomName]); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_NAMESPACE] + ).toEqual('/testing'); + }); + }); + + it('broadcast to multiple rooms', () => { + const io = createServerInstance(); + const namespace = io.of('/testing'); + namespace.to('room1').to('room2').emit('broadcast', '1234'); + expectSpan('/testing[room1,room2] send', span => { + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/testing'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_NAMESPACE] + ).toEqual('/testing'); + expect( + span.attributes[SocketIoInstrumentationAttributes.SOCKET_IO_ROOMS] + ).toEqual(['room1', 'room2']); + }); + }); + + it('on is instrumented', done => { + const config: SocketIoInstrumentationConfig = { + // only for v2: v2 emits connection events which later versions do not + emitIgnoreEventList: ['connection'], + }; + instrumentation.setConfig(config); + createServer((sio, port) => { + const namespace = sio.of('/testing'); + const client = io(`http://localhost:${port}/testing`); + client.on('test', () => client.emit('test_reply')); + namespace.on('connection', (socket: Socket) => { + socket.emit('test'); + socket.on('test_reply', () => { + client.close(); + sio.close(); + //trace is created after the listener method is completed + setTimeout(() => { + expectSpan( + '/testing test_reply receive', + span => { + try { + expect(span.kind).toEqual(SpanKind.CONSUMER); + expect( + span.attributes[SemanticAttributes.MESSAGING_SYSTEM] + ).toEqual('socket.io'); + expect( + span.attributes[SemanticAttributes.MESSAGING_DESTINATION] + ).toEqual('/testing'); + done(); + } catch (e) { + done(e); + } + }, + 2 + ); + }); + }); + }); + }); + }); + }); + + describe('Socket', () => { + it('emit is instrumented', done => { + const config: SocketIoInstrumentationConfig = { + // only for v2: v2 emits connection events which later versions do not + emitIgnoreEventList: ['connection'], + }; + instrumentation.setConfig(config); + createServer((sio, port) => { + const client = io(`http://localhost:${port}`, { + // websockets transport disconnects without the delay of the polling interval + transports: ['websocket'], + }); + sio.on('connection', (socket: Socket) => { + socket.emit('test'); + client.close(); + sio.close(); + setTimeout(() => { + expectSpan( + `/[${socket.id}] send`, + span => { + try { + expect(span.kind).toEqual(SpanKind.PRODUCER); + expect( + span.attributes[SemanticAttributes.MESSAGING_SYSTEM] + ).toEqual('socket.io'); + done(); + } catch (e) { + done(e); + } + }, + 2 + ); + }); + }); + }); + }); + }); +}); diff --git a/plugins/node/instrumentation-socket.io/test/utils.ts b/plugins/node/instrumentation-socket.io/test/utils.ts new file mode 100644 index 0000000000..86144d5f4d --- /dev/null +++ b/plugins/node/instrumentation-socket.io/test/utils.ts @@ -0,0 +1,75 @@ +/* + * 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 { strict as assert } from 'assert'; +import * as http from 'http'; +import { AddressInfo } from 'net'; + +import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; +import { getTestSpans } from '@opentelemetry/contrib-test-utils'; + +import * as expect from 'expect'; +import { Server } from 'socket.io'; +import * as socketIo from 'socket.io'; +import * as ioClient from 'socket.io-client'; +import * as path from 'path'; + +export const io = ioClient.io || ioClient; + +const packageJsonPath = (packageName: string) => + path.join(path.dirname(require.resolve(packageName)), '..', 'package.json'); +const version = require(packageJsonPath('socket.io')).version; + +assert.equal(typeof version, 'string'); + +export const isV2 = version && /^2\./.test(version); + +export const createServer = ( + callback: (server: Server, port: number) => void +) => { + const server = http.createServer(); + const sio = createServerInstance(server); + server.listen(0, () => { + const port = (server.address() as AddressInfo).port; + callback(sio, port); + }); +}; + +export const createServerInstance = (server?: http.Server) => { + if (isV2) { + return (socketIo as any)(server, { serveClient: false }); + } + return new Server(server); +}; + +export const getSocketIoSpans = (): ReadableSpan[] => + getTestSpans().filter( + s => s.attributes[SemanticAttributes.MESSAGING_SYSTEM] === 'socket.io' + ) as ReadableSpan[]; + +export const expectSpan = ( + spanName: string, + callback?: (span: ReadableSpan) => void, + spanCount?: number +) => { + const spans = getSocketIoSpans(); + expect(spans.length).toEqual(spanCount || 1); + const span = spans.find(s => s.name === spanName); + expect(span).toBeDefined(); + if (span && callback) { + callback(span); + } +}; diff --git a/plugins/node/instrumentation-socket.io/tsconfig.json b/plugins/node/instrumentation-socket.io/tsconfig.json new file mode 100644 index 0000000000..3feff66260 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/release-please-config.json b/release-please-config.json index 76911a8653..6894b5d84d 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -23,6 +23,7 @@ "plugins/node/instrumentation-fs": {}, "plugins/node/instrumentation-lru-memoizer": {}, "plugins/node/instrumentation-mongoose": {}, + "plugins/node/instrumentation-socket.io": {}, "plugins/node/instrumentation-tedious": {}, "plugins/node/opentelemetry-instrumentation-aws-lambda": {}, "plugins/node/opentelemetry-instrumentation-aws-sdk": {}, From fef44f4f80770e422bb0123724cfda1067819999 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Thu, 24 Nov 2022 09:31:42 +0200 Subject: [PATCH 07/91] chore(deps): update dependency expect to v29 (#1233) * chore: upgrade expect to v29.2.0 * fix: commit forgotten file --- packages/opentelemetry-propagation-utils/package.json | 2 +- .../test/pubsub-propagation.test.ts | 2 +- plugins/node/instrumentation-amqplib/package.json | 2 +- .../node/instrumentation-amqplib/test/amqplib-callbacks.test.ts | 2 +- .../instrumentation-amqplib/test/amqplib-connection.test.ts | 2 +- .../node/instrumentation-amqplib/test/amqplib-promise.test.ts | 2 +- plugins/node/instrumentation-amqplib/test/utils.test.ts | 2 +- plugins/node/instrumentation-amqplib/test/utils.ts | 2 +- plugins/node/instrumentation-lru-memoizer/package.json | 2 +- plugins/node/instrumentation-lru-memoizer/test/index.test.ts | 2 +- plugins/node/instrumentation-mongoose/package.json | 2 +- plugins/node/instrumentation-mongoose/test/asserts.ts | 2 +- plugins/node/instrumentation-mongoose/test/mongoose.test.ts | 2 +- plugins/node/opentelemetry-instrumentation-aws-sdk/package.json | 2 +- .../test/MessageAttributes.test.ts | 2 +- .../test/aws-sdk-v2.test.ts | 2 +- .../test/aws-sdk-v3.test.ts | 2 +- .../opentelemetry-instrumentation-aws-sdk/test/dynamodb.test.ts | 2 +- .../opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts | 2 +- .../node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts | 2 +- .../node/opentelemetry-instrumentation-aws-sdk/test/sqs.test.ts | 2 +- .../opentelemetry-instrumentation-aws-sdk/test/testing-utils.ts | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/opentelemetry-propagation-utils/package.json b/packages/opentelemetry-propagation-utils/package.json index adae4993a2..44d2e89f8d 100644 --- a/packages/opentelemetry-propagation-utils/package.json +++ b/packages/opentelemetry-propagation-utils/package.json @@ -49,7 +49,7 @@ "@types/mocha": "^9.1.1", "@types/node": "18.11.7", "@types/sinon": "^10.0.11", - "expect": "27.4.2", + "expect": "29.2.0", "gts": "3.1.0", "mocha": "7.2.0", "nyc": "15.1.0", diff --git a/packages/opentelemetry-propagation-utils/test/pubsub-propagation.test.ts b/packages/opentelemetry-propagation-utils/test/pubsub-propagation.test.ts index 8c853b791f..62199d4f33 100644 --- a/packages/opentelemetry-propagation-utils/test/pubsub-propagation.test.ts +++ b/packages/opentelemetry-propagation-utils/test/pubsub-propagation.test.ts @@ -20,7 +20,7 @@ import { resetMemoryExporter, } from '@opentelemetry/contrib-test-utils'; import { ROOT_CONTEXT, trace } from '@opentelemetry/api'; -import * as expect from 'expect'; +import { expect } from 'expect'; registerInstrumentationTestingProvider(); diff --git a/plugins/node/instrumentation-amqplib/package.json b/plugins/node/instrumentation-amqplib/package.json index 0588be63b9..6a4282a7e6 100644 --- a/plugins/node/instrumentation-amqplib/package.json +++ b/plugins/node/instrumentation-amqplib/package.json @@ -59,7 +59,7 @@ "@types/sinon": "10.0.2", "@types/node": "18.11.7", "amqplib": "0.8.0", - "expect": "27.4.2", + "expect": "29.2.0", "lodash": "4.17.21", "mocha": "7.2.0", "ts-mocha": "10.0.0", diff --git a/plugins/node/instrumentation-amqplib/test/amqplib-callbacks.test.ts b/plugins/node/instrumentation-amqplib/test/amqplib-callbacks.test.ts index 424554e4dd..e9fbdf96e8 100644 --- a/plugins/node/instrumentation-amqplib/test/amqplib-callbacks.test.ts +++ b/plugins/node/instrumentation-amqplib/test/amqplib-callbacks.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import 'mocha'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { AmqplibInstrumentation } from '../src'; import { getTestSpans, diff --git a/plugins/node/instrumentation-amqplib/test/amqplib-connection.test.ts b/plugins/node/instrumentation-amqplib/test/amqplib-connection.test.ts index 748f06c7ee..7ac3e686e5 100644 --- a/plugins/node/instrumentation-amqplib/test/amqplib-connection.test.ts +++ b/plugins/node/instrumentation-amqplib/test/amqplib-connection.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import 'mocha'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { shouldTest } from './utils'; import { censoredUrl, diff --git a/plugins/node/instrumentation-amqplib/test/amqplib-promise.test.ts b/plugins/node/instrumentation-amqplib/test/amqplib-promise.test.ts index b343dc71ea..e130f5e942 100644 --- a/plugins/node/instrumentation-amqplib/test/amqplib-promise.test.ts +++ b/plugins/node/instrumentation-amqplib/test/amqplib-promise.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import 'mocha'; -import * as expect from 'expect'; +import { expect } from 'expect'; import * as sinon from 'sinon'; import * as lodash from 'lodash'; import { diff --git a/plugins/node/instrumentation-amqplib/test/utils.test.ts b/plugins/node/instrumentation-amqplib/test/utils.test.ts index efa69b5886..34e6fb7aa9 100644 --- a/plugins/node/instrumentation-amqplib/test/utils.test.ts +++ b/plugins/node/instrumentation-amqplib/test/utils.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import 'mocha'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { getConnectionAttributesFromServer, getConnectionAttributesFromUrl, diff --git a/plugins/node/instrumentation-amqplib/test/utils.ts b/plugins/node/instrumentation-amqplib/test/utils.ts index f6297dfb66..d1e3a2e4ca 100644 --- a/plugins/node/instrumentation-amqplib/test/utils.ts +++ b/plugins/node/instrumentation-amqplib/test/utils.ts @@ -15,7 +15,7 @@ */ import type * as amqp from 'amqplib'; import type * as amqpCallback from 'amqplib/callback_api'; -import * as expect from 'expect'; +import { expect } from 'expect'; export const asyncConfirmSend = ( confirmChannel: amqp.ConfirmChannel | amqpCallback.ConfirmChannel, diff --git a/plugins/node/instrumentation-lru-memoizer/package.json b/plugins/node/instrumentation-lru-memoizer/package.json index 49c7e6e37d..caec77996e 100644 --- a/plugins/node/instrumentation-lru-memoizer/package.json +++ b/plugins/node/instrumentation-lru-memoizer/package.json @@ -47,7 +47,7 @@ "@types/lru-cache": "7.10.9", "@types/mocha": "8.2.3", "@types/node": "18.11.7", - "expect": "25.5.0", + "expect": "29.2.0", "gts": "3.1.0", "lru-memoizer": "2.1.4", "mocha": "7.2.0", diff --git a/plugins/node/instrumentation-lru-memoizer/test/index.test.ts b/plugins/node/instrumentation-lru-memoizer/test/index.test.ts index 95969e8be8..bb80c9994d 100644 --- a/plugins/node/instrumentation-lru-memoizer/test/index.test.ts +++ b/plugins/node/instrumentation-lru-memoizer/test/index.test.ts @@ -15,7 +15,7 @@ */ import LruMemoizerInstrumentation from '../src'; import { trace, context } from '@opentelemetry/api'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { registerInstrumentationTesting } from '@opentelemetry/contrib-test-utils'; diff --git a/plugins/node/instrumentation-mongoose/package.json b/plugins/node/instrumentation-mongoose/package.json index 6edb5db039..99e77cf6a3 100644 --- a/plugins/node/instrumentation-mongoose/package.json +++ b/plugins/node/instrumentation-mongoose/package.json @@ -50,7 +50,7 @@ "@opentelemetry/sdk-trace-base": "^1.8.0", "@types/mocha": "8.2.3", "@types/node": "18.11.7", - "expect": "27.4.2", + "expect": "29.2.0", "gts": "3.1.0", "mocha": "7.2.0", "mongoose": "6.5.2", diff --git a/plugins/node/instrumentation-mongoose/test/asserts.ts b/plugins/node/instrumentation-mongoose/test/asserts.ts index f6c7e15ec3..ad21f9a716 100644 --- a/plugins/node/instrumentation-mongoose/test/asserts.ts +++ b/plugins/node/instrumentation-mongoose/test/asserts.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import * as expect from 'expect'; +import { expect } from 'expect'; import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { SpanStatusCode } from '@opentelemetry/api'; diff --git a/plugins/node/instrumentation-mongoose/test/mongoose.test.ts b/plugins/node/instrumentation-mongoose/test/mongoose.test.ts index 6ba0297bd5..9049762e0e 100644 --- a/plugins/node/instrumentation-mongoose/test/mongoose.test.ts +++ b/plugins/node/instrumentation-mongoose/test/mongoose.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import 'mocha'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { context, ROOT_CONTEXT } from '@opentelemetry/api'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { MongooseInstrumentation } from '../src'; diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json index 48cb5b90b5..4535cbdc8f 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json @@ -66,7 +66,7 @@ "@types/sinon": "10.0.6", "aws-sdk": "2.1008.0", "eslint": "8.7.0", - "expect": "27.4.2", + "expect": "29.2.0", "gts": "3.1.0", "mocha": "7.2.0", "nock": "13.2.1", diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/MessageAttributes.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/MessageAttributes.test.ts index 77717b53c5..51d63442f0 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/MessageAttributes.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/MessageAttributes.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as expect from 'expect'; +import { expect } from 'expect'; import { MAX_MESSAGE_ATTRIBUTES, contextSetter, diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v2.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v2.test.ts index f40f80903b..0d7d8a8aea 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v2.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v2.test.ts @@ -31,7 +31,7 @@ import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import { SpanStatusCode, Span, SpanKind } from '@opentelemetry/api'; import { AttributeNames } from '../src/enums'; import { mockV2AwsSend } from './testing-utils'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; describe('instrumentation-aws-sdk-v2', () => { diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v3.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v3.test.ts index 8623b6e873..0fb17f7ffd 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v3.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v3.test.ts @@ -47,7 +47,7 @@ import { SemanticAttributes, } from '@opentelemetry/semantic-conventions'; import { AttributeNames } from '../src/enums'; -import * as expect from 'expect'; +import { expect } from 'expect'; import * as fs from 'fs'; import * as nock from 'nock'; diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/dynamodb.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/dynamodb.test.ts index 41b715770a..5ff0c2b0ab 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/dynamodb.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/dynamodb.test.ts @@ -27,7 +27,7 @@ import { DbSystemValues, SemanticAttributes, } from '@opentelemetry/semantic-conventions'; -import * as expect from 'expect'; +import { expect } from 'expect'; import type { ConsumedCapacity as ConsumedCapacityV2 } from 'aws-sdk/clients/dynamodb'; import type { ConsumedCapacity as ConsumedCapacityV3 } from '@aws-sdk/client-dynamodb'; diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts index 372ebc4e67..be3965a872 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts @@ -27,7 +27,7 @@ import { SpanKind } from '@opentelemetry/api'; import { Lambda, InvocationType } from '@aws-sdk/client-lambda'; import { ClientRequest } from 'http'; import * as nock from 'nock'; -import * as expect from 'expect'; +import { expect } from 'expect'; process.env.AWS_ACCESS_KEY_ID = 'testing'; process.env.AWS_SECRET_ACCESS_KEY = 'testing'; diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts index a930dba4a1..ce6ce9c885 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts @@ -27,7 +27,7 @@ import * as fs from 'fs'; import * as nock from 'nock'; import { mockV2AwsSend } from './testing-utils'; -import * as expect from 'expect'; +import { expect } from 'expect'; import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import * as sinon from 'sinon'; import { diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sqs.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sqs.test.ts index 901b4fca1d..e162fa57e8 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sqs.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sqs.test.ts @@ -39,7 +39,7 @@ import { import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import { mockV2AwsSend } from './testing-utils'; import { Message } from 'aws-sdk/clients/sqs'; -import * as expect from 'expect'; +import { expect } from 'expect'; import * as sinon from 'sinon'; import * as messageAttributes from '../src/services/MessageAttributes'; import { AttributeNames } from '../src/enums'; diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/testing-utils.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/testing-utils.ts index a08f3e1237..7ce6d373cc 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/testing-utils.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/testing-utils.ts @@ -16,7 +16,7 @@ import { context } from '@opentelemetry/api'; import { isTracingSuppressed } from '@opentelemetry/core'; import { getInstrumentation } from '@opentelemetry/contrib-test-utils'; -import * as expect from 'expect'; +import { expect } from 'expect'; import * as AWS from 'aws-sdk'; // we want to mock the request object and trigger events on it's events emitter. From a0003e76fc46afbbee2558a7d21906be7c9cb1d1 Mon Sep 17 00:00:00 2001 From: Henri Normak Date: Thu, 24 Nov 2022 17:51:42 +0200 Subject: [PATCH 08/91] feat: add sqlcommenter comment with trace context to queries in pg instrumentation (#1286) --- .../README.md | 2 + .../package.json | 3 + .../src/instrumentation.ts | 16 +++ .../src/types.ts | 6 + .../src/utils.ts | 69 ++++++++++ .../test/pg.test.ts | 123 ++++++++++++++++++ .../test/utils.test.ts | 99 +++++++++++++- 7 files changed, 317 insertions(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-pg/README.md b/plugins/node/opentelemetry-instrumentation-pg/README.md index 578b2cc173..b14e036343 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/README.md +++ b/plugins/node/opentelemetry-instrumentation-pg/README.md @@ -48,6 +48,8 @@ PostgreSQL instrumentation has few options available to choose from. You can set | ------- | ---- | ----------- | | [`enhancedDatabaseReporting`](./src/types.ts#L30) | `boolean` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations | | `responseHook` | `PgInstrumentationExecutionResponseHook` (function) | Function for adding custom attributes from db response | +| `requireParentSpan` | `boolean` | If true, requires a parent span to create new spans (default false) | +| `addSqlCommenterCommentToQueries` | `boolean` | If true, adds [sqlcommenter](https://github.com/open-telemetry/opentelemetry-sqlcommenter) specification compliant comment to queries with tracing context (default false). _NOTE: A comment will not be added to queries that already contain `--` or `/* ... */` in them, even if these are not actually part of comments_ | ## Useful links diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index 917139df6e..fdf69fe8be 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -60,6 +60,7 @@ "@opentelemetry/sdk-trace-node": "^1.8.0", "@types/mocha": "7.0.2", "@types/node": "18.11.7", + "@types/sinon": "10.0.2", "cross-env": "7.0.3", "gts": "3.1.0", "mocha": "7.2.0", @@ -67,11 +68,13 @@ "pg": "8.7.1", "pg-pool": "3.4.1", "rimraf": "3.0.2", + "sinon": "14.0.0", "test-all-versions": "5.0.1", "ts-mocha": "10.0.0", "typescript": "4.3.5" }, "dependencies": { + "@opentelemetry/core": "^1.8.0", "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/pg": "8.6.1", diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts index 7c1b6d77f2..f309555951 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts @@ -178,6 +178,7 @@ export class PgInstrumentation extends InstrumentationBase { // Handle different client.query(...) signatures if (typeof args[0] === 'string') { const query = args[0]; + if (args.length > 1 && args[1] instanceof Array) { const params = args[1]; span = utils.handleParameterizedQuery.call( @@ -195,14 +196,29 @@ export class PgInstrumentation extends InstrumentationBase { query ); } + + if (plugin.getConfig().addSqlCommenterCommentToQueries) { + // Modify the query with a tracing comment + args[0] = utils.addSqlCommenterComment(span, args[0]); + } } else if (typeof args[0] === 'object') { const queryConfig = args[0] as NormalizedQueryConfig; + span = utils.handleConfigQuery.call( this, plugin.tracer, plugin.getConfig(), queryConfig ); + + if (plugin.getConfig().addSqlCommenterCommentToQueries) { + // Copy the query config instead of writing to args[0].text so that we don't modify user's + // original query config reference + args[0] = { + ...queryConfig, + text: utils.addSqlCommenterComment(span, queryConfig.text), + }; + } } else { return utils.handleInvalidQuery.call( this, diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/types.ts b/plugins/node/opentelemetry-instrumentation-pg/src/types.ts index d37ab0323f..3e0d280cad 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/types.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/types.ts @@ -46,4 +46,10 @@ export interface PgInstrumentationConfig extends InstrumentationConfig { * @default false */ requireParentSpan?: boolean; + + /** + * If true, queries are modified to also include a comment with + * the tracing context, following the {@link https://github.com/open-telemetry/opentelemetry-sqlcommenter sqlcommenter} format + */ + addSqlCommenterCommentToQueries?: boolean; } diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts index 7e5359c4ec..048c0d7ad0 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts @@ -24,7 +24,10 @@ import { diag, INVALID_SPAN_CONTEXT, Attributes, + defaultTextMapSetter, + ROOT_CONTEXT, } from '@opentelemetry/api'; +import { W3CTraceContextPropagator } from '@opentelemetry/core'; import { AttributeNames } from './enums/AttributeNames'; import { SemanticAttributes, @@ -289,3 +292,69 @@ export function patchClientConnectCallback( cb.call(this, err); }; } + +// NOTE: This function currently is returning false-positives +// in cases where comment characters appear in string literals +// ("SELECT '-- not a comment';" would return true, although has no comment) +function hasValidSqlComment(query: string): boolean { + const indexOpeningDashDashComment = query.indexOf('--'); + if (indexOpeningDashDashComment >= 0) { + return true; + } + + const indexOpeningSlashComment = query.indexOf('/*'); + if (indexOpeningSlashComment < 0) { + return false; + } + + const indexClosingSlashComment = query.indexOf('*/'); + return indexOpeningDashDashComment < indexClosingSlashComment; +} + +// sqlcommenter specification (https://google.github.io/sqlcommenter/spec/#value-serialization) +// expects us to URL encode based on the RFC 3986 spec (https://en.wikipedia.org/wiki/Percent-encoding), +// but encodeURIComponent does not handle some characters correctly (! ' ( ) *), +// which means we need special handling for this +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent +function fixedEncodeURIComponent(str: string) { + return encodeURIComponent(str).replace( + /[!'()*]/g, + c => `%${c.charCodeAt(0).toString(16).toUpperCase()}` + ); +} + +export function addSqlCommenterComment(span: Span, query: string): string { + if (typeof query !== 'string' || query.length === 0) { + return query; + } + + // As per sqlcommenter spec we shall not add a comment if there already is a comment + // in the query + if (hasValidSqlComment(query)) { + return query; + } + + const propagator = new W3CTraceContextPropagator(); + const headers: { [key: string]: string } = {}; + propagator.inject( + trace.setSpan(ROOT_CONTEXT, span), + headers, + defaultTextMapSetter + ); + + // sqlcommenter spec requires keys in the comment to be sorted lexicographically + const sortedKeys = Object.keys(headers).sort(); + + if (sortedKeys.length === 0) { + return query; + } + + const commentString = sortedKeys + .map(key => { + const encodedValue = fixedEncodeURIComponent(headers[key]); + return `${key}='${encodedValue}'`; + }) + .join(','); + + return `${query} /*${commentString}*/`; +} diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts index d43eb7537f..e91b0034fb 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts @@ -32,6 +32,7 @@ import { } from '@opentelemetry/sdk-trace-base'; import * as assert from 'assert'; import type * as pg from 'pg'; +import * as sinon from 'sinon'; import { PgInstrumentation, PgInstrumentationConfig, @@ -44,6 +45,7 @@ import { DbSystemValues, } from '@opentelemetry/semantic-conventions'; import { isSupported } from './utils'; +import { addSqlCommenterComment } from '../src/utils'; const pgVersion = require('pg/package.json').version; const nodeVersion = process.versions.node; @@ -110,6 +112,12 @@ describe('pg', () => { const testPostgresLocally = process.env.RUN_POSTGRES_TESTS_LOCAL; // For local: spins up local postgres db via docker const shouldTest = testPostgres || testPostgresLocally; // Skips these tests if false (default) + function getExecutedQueries() { + return (client as any).queryQueue.push.args.flat() as (pg.Query & { + text?: string; + })[]; + } + before(async function () { const skipForUnsupported = process.env.IN_TAV && !isSupported(nodeVersion, pgVersion); @@ -156,11 +164,16 @@ describe('pg', () => { beforeEach(() => { contextManager = new AsyncHooksContextManager().enable(); context.setGlobalContextManager(contextManager); + + // Add a spy on the underlying client's internal query queue so that + // we could assert on what the final queries are that are executed + sinon.spy((client as any).queryQueue, 'push'); }); afterEach(() => { memoryExporter.reset(); context.disable(); + sinon.restore(); }); it('should return an instrumentation', () => { @@ -649,6 +662,116 @@ describe('pg', () => { }); }); + it('should not add sqlcommenter comment when flag is not specified', async () => { + const span = tracer.startSpan('test span'); + await context.with(trace.setSpan(context.active(), span), async () => { + try { + const query = 'SELECT NOW()'; + const resPromise = await client.query(query); + assert.ok(resPromise); + + const [span] = memoryExporter.getFinishedSpans(); + assert.ok(span); + + const commentedQuery = addSqlCommenterComment( + trace.wrapSpanContext(span.spanContext()), + query + ); + + const executedQueries = getExecutedQueries(); + assert.equal(executedQueries.length, 1); + assert.equal(executedQueries[0].text, query); + assert.notEqual(query, commentedQuery); + } catch (e) { + assert.ok(false, e.message); + } + }); + }); + + it('should not add sqlcommenter comment with client.query({text, callback}) when flag is not specified', done => { + const span = tracer.startSpan('test span'); + context.with(trace.setSpan(context.active(), span), () => { + const query = 'SELECT NOW()'; + client.query({ + text: query, + callback: (err: Error, res: pg.QueryResult) => { + assert.strictEqual(err, null); + assert.ok(res); + + const [span] = memoryExporter.getFinishedSpans(); + const commentedQuery = addSqlCommenterComment( + trace.wrapSpanContext(span.spanContext()), + query + ); + + const executedQueries = getExecutedQueries(); + assert.equal(executedQueries.length, 1); + assert.equal(executedQueries[0].text, query); + assert.notEqual(query, commentedQuery); + done(); + }, + } as pg.QueryConfig); + }); + }); + + it('should add sqlcommenter comment when addSqlCommenterCommentToQueries=true is specified', async () => { + instrumentation.setConfig({ + addSqlCommenterCommentToQueries: true, + }); + + const span = tracer.startSpan('test span'); + await context.with(trace.setSpan(context.active(), span), async () => { + try { + const query = 'SELECT NOW()'; + const resPromise = await client.query(query); + assert.ok(resPromise); + + const [span] = memoryExporter.getFinishedSpans(); + const commentedQuery = addSqlCommenterComment( + trace.wrapSpanContext(span.spanContext()), + query + ); + + const executedQueries = getExecutedQueries(); + assert.equal(executedQueries.length, 1); + assert.equal(executedQueries[0].text, commentedQuery); + assert.notEqual(query, commentedQuery); + } catch (e) { + assert.ok(false, e.message); + } + }); + }); + + it('should add sqlcommenter comment when addSqlCommenterCommentToQueries=true is specified with client.query({text, callback})', done => { + instrumentation.setConfig({ + addSqlCommenterCommentToQueries: true, + }); + + const span = tracer.startSpan('test span'); + context.with(trace.setSpan(context.active(), span), () => { + const query = 'SELECT NOW()'; + client.query({ + text: query, + callback: (err: Error, res: pg.QueryResult) => { + assert.strictEqual(err, null); + assert.ok(res); + + const [span] = memoryExporter.getFinishedSpans(); + const commentedQuery = addSqlCommenterComment( + trace.wrapSpanContext(span.spanContext()), + query + ); + + const executedQueries = getExecutedQueries(); + assert.equal(executedQueries.length, 1); + assert.equal(executedQueries[0].text, commentedQuery); + assert.notEqual(query, commentedQuery); + done(); + }, + } as pg.QueryConfig); + }); + }); + it('should not generate traces for client.query() when requireParentSpan=true is specified', done => { instrumentation.setConfig({ requireParentSpan: true, diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts index 6bb03076bf..4b43e4da95 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts @@ -14,7 +14,14 @@ * limitations under the License. */ -import { context, INVALID_SPAN_CONTEXT, trace } from '@opentelemetry/api'; +import { + context, + createTraceState, + INVALID_SPAN_CONTEXT, + SpanContext, + trace, + TraceFlags, +} from '@opentelemetry/api'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; import { InstrumentationConfig } from '@opentelemetry/instrumentation'; import { @@ -204,4 +211,94 @@ describe('utils.ts', () => { assert.strictEqual(pgValues, '[0]'); }); }); + + describe('addSqlCommenterComment', () => { + it('adds comment to a simple query', () => { + const spanContext: SpanContext = { + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: TraceFlags.SAMPLED, + }; + + const query = 'SELECT * from FOO;'; + assert.strictEqual( + utils.addSqlCommenterComment(trace.wrapSpanContext(spanContext), query), + "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01'*/" + ); + }); + + it('does not add a comment if query already has a comment', () => { + const span = trace.wrapSpanContext({ + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: TraceFlags.SAMPLED, + }); + + const blockComment = 'SELECT * from FOO; /* Test comment */'; + assert.strictEqual( + utils.addSqlCommenterComment(span, blockComment), + blockComment + ); + + const dashedComment = 'SELECT * from FOO; -- Test comment'; + assert.strictEqual( + utils.addSqlCommenterComment(span, dashedComment), + dashedComment + ); + }); + + it('does not add a comment to an empty query', () => { + const spanContext: SpanContext = { + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: TraceFlags.SAMPLED, + }; + + assert.strictEqual( + utils.addSqlCommenterComment(trace.wrapSpanContext(spanContext), ''), + '' + ); + }); + + it('does not add a comment if span context is invalid', () => { + const query = 'SELECT * from FOO;'; + assert.strictEqual( + utils.addSqlCommenterComment( + trace.wrapSpanContext(INVALID_SPAN_CONTEXT), + query + ), + query + ); + }); + + it('correctly also sets trace state', () => { + const spanContext: SpanContext = { + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: TraceFlags.SAMPLED, + traceState: createTraceState('foo=bar,baz=qux'), + }; + + const query = 'SELECT * from FOO;'; + assert.strictEqual( + utils.addSqlCommenterComment(trace.wrapSpanContext(spanContext), query), + "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01',tracestate='foo%3Dbar%2Cbaz%3Dqux'*/" + ); + }); + + it('escapes special characters in values', () => { + const spanContext: SpanContext = { + traceId: 'd4cda95b652f4a1592b449d5929fda1b', + spanId: '6e0c63257de34c92', + traceFlags: TraceFlags.SAMPLED, + traceState: createTraceState("foo='bar,baz='qux!()*',hack='DROP TABLE"), + }; + + const query = 'SELECT * from FOO;'; + assert.strictEqual( + utils.addSqlCommenterComment(trace.wrapSpanContext(spanContext), query), + "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01',tracestate='foo%3D%27bar%2Cbaz%3D%27qux%21%28%29%2A%27%2Chack%3D%27DROP%20TABLE'*/" + ); + }); + }); }); From 4cafe6becc19cfb76c53393cb03a5c0574a68b0d Mon Sep 17 00:00:00 2001 From: Thomas Ankcorn Date: Thu, 24 Nov 2022 17:51:00 +0000 Subject: [PATCH 09/91] Fix typo in aws-lambda plugin (#1300) --- .../node/opentelemetry-instrumentation-aws-lambda/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md b/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md index 98cf98025e..7251803be6 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/README.md @@ -60,11 +60,11 @@ const { AwsLambdaInstrumentation } = require('@opentelemetry/instrumentation-aws new AwsLambdaInstrumentation({ requestHook: (span, { event, context }) => { - span.setAttributes('faas.name', context.functionName); + span.setAttribute('faas.name', context.functionName); }, responseHook: (span, { err, res }) => { - if (err instanceof Error) span.setAttributes('faas.error', err.message); - if (res) span.setAttributes('faas.res', res); + if (err instanceof Error) span.setAttribute('faas.error', err.message); + if (res) span.setAttribute('faas.res', res); } }) ``` From 092a2509bcf884e1b997e0eaec3a6ca02cfd2058 Mon Sep 17 00:00:00 2001 From: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com> Date: Sun, 27 Nov 2022 11:23:20 +0200 Subject: [PATCH 10/91] fix(redis): serialize non sensitive arguments into db.statement attribute (#1299) --- .release-please-manifest.json | 3 +- examples/ioredis/tracer.js | 1 + .../opentelemetry-redis-common/.eslintignore | 1 + .../opentelemetry-redis-common/.eslintrc.js | 7 + packages/opentelemetry-redis-common/LICENSE | 201 ++++++++++++++++++ packages/opentelemetry-redis-common/README.md | 7 + .../opentelemetry-redis-common/package.json | 50 +++++ .../opentelemetry-redis-common/src/index.ts | 76 +++++++ .../test/redis-common.test.ts | 54 +++++ .../opentelemetry-redis-common/tsconfig.json | 11 + .../README.md | 3 +- .../package.json | 1 + .../src/instrumentation.ts | 3 +- .../src/utils.ts | 50 ----- .../test/ioredis.test.ts | 48 +---- .../README.md | 8 +- .../package.json | 1 + .../src/instrumentation.ts | 3 +- .../src/utils.ts | 4 - .../test/redis.test.ts | 12 +- .../README.md | 8 +- .../package.json | 1 + .../src/utils.ts | 9 +- .../test/redis.test.ts | 6 +- release-please-config.json | 1 + 25 files changed, 444 insertions(+), 125 deletions(-) create mode 100644 packages/opentelemetry-redis-common/.eslintignore create mode 100644 packages/opentelemetry-redis-common/.eslintrc.js create mode 100644 packages/opentelemetry-redis-common/LICENSE create mode 100644 packages/opentelemetry-redis-common/README.md create mode 100644 packages/opentelemetry-redis-common/package.json create mode 100644 packages/opentelemetry-redis-common/src/index.ts create mode 100644 packages/opentelemetry-redis-common/test/redis-common.test.ts create mode 100644 packages/opentelemetry-redis-common/tsconfig.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e41db53c94..9910dc9599 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,2 +1 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0", "plugins/node/instrumentation-socket.io": "0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} - +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-redis-common":"0.33.0","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-socket.io": "0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} diff --git a/examples/ioredis/tracer.js b/examples/ioredis/tracer.js index dec989fec2..6d18533d9a 100644 --- a/examples/ioredis/tracer.js +++ b/examples/ioredis/tracer.js @@ -20,6 +20,7 @@ registerInstrumentations({ instrumentations: [ new IORedisInstrumentation(), ], + tracerProvider: provider, }); module.exports = opentelemetry.trace.getTracer('ioredis-example'); diff --git a/packages/opentelemetry-redis-common/.eslintignore b/packages/opentelemetry-redis-common/.eslintignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/packages/opentelemetry-redis-common/.eslintignore @@ -0,0 +1 @@ +build diff --git a/packages/opentelemetry-redis-common/.eslintrc.js b/packages/opentelemetry-redis-common/.eslintrc.js new file mode 100644 index 0000000000..f726f3becb --- /dev/null +++ b/packages/opentelemetry-redis-common/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + "env": { + "mocha": true, + "node": true + }, + ...require('../../eslint.config.js') +} diff --git a/packages/opentelemetry-redis-common/LICENSE b/packages/opentelemetry-redis-common/LICENSE new file mode 100644 index 0000000000..e50e8c80f9 --- /dev/null +++ b/packages/opentelemetry-redis-common/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/opentelemetry-redis-common/README.md b/packages/opentelemetry-redis-common/README.md new file mode 100644 index 0000000000..bb8de2d704 --- /dev/null +++ b/packages/opentelemetry-redis-common/README.md @@ -0,0 +1,7 @@ +# Redis Common Utils for OpenTelemetry redis packages + +This is an internal utils package used for the different redis instrumentations: + +1. ioredis +2. redis +3. redis-4 diff --git a/packages/opentelemetry-redis-common/package.json b/packages/opentelemetry-redis-common/package.json new file mode 100644 index 0000000000..037c492099 --- /dev/null +++ b/packages/opentelemetry-redis-common/package.json @@ -0,0 +1,50 @@ +{ + "name": "@opentelemetry/redis-common", + "version": "0.33.0", + "description": "Redis utilities for redis instrumentations", + "main": "build/src/index.js", + "types": "build/src/index.d.ts", + "publishConfig": { + "access": "public" + }, + "scripts": { + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "compile": "tsc --build tsconfig.json", + "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/redis-common --include-dependencies", + "prewatch": "npm run precompile", + "prepare": "npm run compile", + "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", + "watch": "tsc -w" + }, + "repository": "open-telemetry/opentelemetry-js-contrib", + "keywords": [ + "opentelemetry", + "redis-common" + ], + "files": [ + "build/**/*.js", + "build/**/*.js.map", + "build/**/*.d.ts", + "LICENSE", + "README.md" + ], + "author": "OpenTelemetry Authors", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + }, + "bugs": { + "url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues" + }, + "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/redis-common#readme", + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "18.11.7", + "gts": "3.1.0", + "mocha": "7.2.0", + "nyc": "15.1.0", + "ts-mocha": "10.0.0", + "typescript": "4.3.5" + } +} diff --git a/packages/opentelemetry-redis-common/src/index.ts b/packages/opentelemetry-redis-common/src/index.ts new file mode 100644 index 0000000000..03f0d2845a --- /dev/null +++ b/packages/opentelemetry-redis-common/src/index.ts @@ -0,0 +1,76 @@ +/* + * 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. + */ + +/** + * List of regexes and the number of arguments that should be serialized for matching commands. + * For example, HSET should serialize which key and field it's operating on, but not its value. + * Setting the subset to -1 will serialize all arguments. + * Commands without a match will have their first argument serialized. + * + * Refer to https://redis.io/commands/ for the full list. + */ +const serializationSubsets = [ + { + regex: /^ECHO/i, + args: 0, + }, + { + regex: /^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i, + args: 1, + }, + { + regex: /^(HSET|HMSET|LSET|LINSERT)/i, + args: 2, + }, + { + regex: + /^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i, + args: -1, + }, +]; + +export type DbStatementSerializer = ( + cmdName: string, + cmdArgs: Array +) => string; + +/** + * Given the redis command name and arguments, return a combination of the + * command name + the allowed arguments according to `serializationSubsets`. + * @param cmdName The redis command name + * @param cmdArgs The redis command arguments + * @returns a combination of the command name + args according to `serializationSubsets`. + */ +export const defaultDbStatementSerializer: DbStatementSerializer = ( + cmdName, + cmdArgs +) => { + if (Array.isArray(cmdArgs) && cmdArgs.length) { + const nArgsToSerialize = + serializationSubsets.find(({ regex }) => { + return regex.test(cmdName); + })?.args ?? 0; + const argsToSerialize = + nArgsToSerialize >= 0 ? cmdArgs.slice(0, nArgsToSerialize) : cmdArgs; + if (cmdArgs.length > argsToSerialize.length) { + argsToSerialize.push( + `[${cmdArgs.length - nArgsToSerialize} other arguments]` + ); + } + return `${cmdName} ${argsToSerialize.join(' ')}`; + } + return cmdName; +}; diff --git a/packages/opentelemetry-redis-common/test/redis-common.test.ts b/packages/opentelemetry-redis-common/test/redis-common.test.ts new file mode 100644 index 0000000000..874903fadd --- /dev/null +++ b/packages/opentelemetry-redis-common/test/redis-common.test.ts @@ -0,0 +1,54 @@ +/* + * 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 { defaultDbStatementSerializer } from '../src/index'; +import * as assert from 'assert'; + +describe('#defaultDbStatementSerializer()', () => { + [ + { + cmdName: 'UNKNOWN', + cmdArgs: ['something'], + expected: 'UNKNOWN [1 other arguments]', + }, + { + cmdName: 'ECHO', + cmdArgs: ['echo'], + expected: 'ECHO [1 other arguments]', + }, + { + cmdName: 'LPUSH', + cmdArgs: ['list', 'value'], + expected: 'LPUSH list [1 other arguments]', + }, + { + cmdName: 'HSET', + cmdArgs: ['hash', 'field', 'value'], + expected: 'HSET hash field [1 other arguments]', + }, + { + cmdName: 'INCRBY', + cmdArgs: ['key', 5], + expected: 'INCRBY key 5', + }, + ].forEach(({ cmdName, cmdArgs, expected }) => { + it(`should serialize the correct number of arguments for ${cmdName}`, () => { + assert.strictEqual( + defaultDbStatementSerializer(cmdName, cmdArgs), + expected + ); + }); + }); +}); diff --git a/packages/opentelemetry-redis-common/tsconfig.json b/packages/opentelemetry-redis-common/tsconfig.json new file mode 100644 index 0000000000..4078877ce6 --- /dev/null +++ b/packages/opentelemetry-redis-common/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-ioredis/README.md b/plugins/node/opentelemetry-instrumentation-ioredis/README.md index 79159202f4..a9d72ffd3d 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/README.md +++ b/plugins/node/opentelemetry-instrumentation-ioredis/README.md @@ -57,7 +57,8 @@ IORedis instrumentation has few options available to choose from. You can set th The instrumentation serializes the command into a Span attribute called `db.statement`. The standard serialization format attempts to be as informative as possible while avoiding the export of potentially sensitive data. The number of serialized arguments depends on the specific command, see the configuration -list in `src/utils.ts`. +list in `@opentelemetry/redis-common`. + It is also possible to define a custom serialization function. The function will receive the command name and arguments and must return a string. Here is a simple example to serialize the command name skipping arguments: diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/package.json b/plugins/node/opentelemetry-instrumentation-ioredis/package.json index 6fd3593ade..32522684f7 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/package.json +++ b/plugins/node/opentelemetry-instrumentation-ioredis/package.json @@ -71,6 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/redis-common": "^0.33.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/ioredis": "4.26.6" }, diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts index ce5b9d10a8..ac2d32b8d1 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts @@ -27,7 +27,8 @@ import { SemanticAttributes, } from '@opentelemetry/semantic-conventions'; import { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation'; -import { endSpan, defaultDbStatementSerializer } from './utils'; +import { endSpan } from './utils'; +import { defaultDbStatementSerializer } from '@opentelemetry/redis-common'; import { VERSION } from './version'; const DEFAULT_CONFIG: IORedisInstrumentationConfig = { diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/src/utils.ts b/plugins/node/opentelemetry-instrumentation-ioredis/src/utils.ts index 55c93fee0f..6250284342 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-ioredis/src/utils.ts @@ -15,35 +15,6 @@ */ import { Span, SpanStatusCode } from '@opentelemetry/api'; -import { DbStatementSerializer } from './types'; - -/** - * List of regexes and the number of arguments that should be serialized for matching commands. - * For example, HSET should serialize which key and field it's operating on, but not its value. - * Setting the subset to -1 will serialize all arguments. - * Commands without a match will have their first argument serialized. - * - * Refer to https://redis.io/commands/ for the full list. - */ -const serializationSubsets = [ - { - regex: /^ECHO/i, - args: 0, - }, - { - regex: /^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i, - args: 1, - }, - { - regex: /^(HSET|HMSET|LSET|LINSERT)/i, - args: 2, - }, - { - regex: - /^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i, - args: -1, - }, -]; export const endSpan = ( span: Span, @@ -58,24 +29,3 @@ export const endSpan = ( } span.end(); }; - -export const defaultDbStatementSerializer: DbStatementSerializer = ( - cmdName, - cmdArgs -) => { - if (Array.isArray(cmdArgs) && cmdArgs.length) { - const nArgsToSerialize = - serializationSubsets.find(({ regex }) => { - return regex.test(cmdName); - })?.args ?? 0; - const argsToSerialize = - nArgsToSerialize >= 0 ? cmdArgs.slice(0, nArgsToSerialize) : cmdArgs; - if (cmdArgs.length > argsToSerialize.length) { - argsToSerialize.push( - `[${cmdArgs.length - nArgsToSerialize} other arguments]` - ); - } - return `${cmdName} ${argsToSerialize.join(' ')}`; - } - return cmdName; -}; diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/test/ioredis.test.ts b/plugins/node/opentelemetry-instrumentation-ioredis/test/ioredis.test.ts index dae05f48ba..a54ea1b812 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/test/ioredis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-ioredis/test/ioredis.test.ts @@ -43,7 +43,6 @@ import { DbSystemValues, SemanticAttributes, } from '@opentelemetry/semantic-conventions'; -import { defaultDbStatementSerializer } from '../src/utils'; const memoryExporter = new InMemorySpanExporter(); @@ -188,14 +187,14 @@ describe('ioredis', () => { description: string; name: string; args: Array; - serializedArgs: Array; + expectedDbStatement: string; method: (cb: ioredisTypes.CallbackFunction) => unknown; }> = [ { description: 'insert', name: 'hset', args: [hashKeyName, 'testField', 'testValue'], - serializedArgs: [hashKeyName, 'testField', '[1 other arguments]'], + expectedDbStatement: `${hashKeyName} testField [1 other arguments]`, method: (cb: ioredisTypes.CallbackFunction) => client.hset(hashKeyName, 'testField', 'testValue', cb), }, @@ -203,7 +202,7 @@ describe('ioredis', () => { description: 'get', name: 'get', args: [testKeyName], - serializedArgs: [testKeyName], + expectedDbStatement: `${testKeyName}`, method: (cb: ioredisTypes.CallbackFunction) => client.get(testKeyName, cb), }, @@ -245,9 +244,7 @@ describe('ioredis', () => { it(`should create a child span for cb style ${command.description}`, done => { const attributes = { ...DEFAULT_ATTRIBUTES, - [SemanticAttributes.DB_STATEMENT]: `${ - command.name - } ${command.serializedArgs.join(' ')}`, + [SemanticAttributes.DB_STATEMENT]: `${command.name} ${command.expectedDbStatement}`, }; const span = provider .getTracer('ioredis-test') @@ -1002,41 +999,4 @@ describe('ioredis', () => { }); }); }); - - describe('#defaultDbStatementSerializer()', () => { - [ - { - cmdName: 'UNKNOWN', - cmdArgs: ['something'], - expected: 'UNKNOWN [1 other arguments]', - }, - { - cmdName: 'ECHO', - cmdArgs: ['echo'], - expected: 'ECHO [1 other arguments]', - }, - { - cmdName: 'LPUSH', - cmdArgs: ['list', 'value'], - expected: 'LPUSH list [1 other arguments]', - }, - { - cmdName: 'HSET', - cmdArgs: ['hash', 'field', 'value'], - expected: 'HSET hash field [1 other arguments]', - }, - { - cmdName: 'INCRBY', - cmdArgs: ['key', 5], - expected: 'INCRBY key 5', - }, - ].forEach(({ cmdName, cmdArgs, expected }) => { - it(`should serialize the correct number of arguments for ${cmdName}`, () => { - assert.strictEqual( - defaultDbStatementSerializer(cmdName, cmdArgs), - expected - ); - }); - }); - }); }); diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/README.md b/plugins/node/opentelemetry-instrumentation-redis-4/README.md index 7d4870a511..dec67f105d 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/README.md +++ b/plugins/node/opentelemetry-instrumentation-redis-4/README.md @@ -53,14 +53,14 @@ Redis instrumentation has a few options available to choose from. You can set th #### Custom `db.statement` Serializer -The instrumentation serializes the command into a Span attribute called -`db.statement`. The default serialization sets the attribute to the command -name, without the command arguments. +The instrumentation serializes the command into a Span attribute called `db.statement`. The standard serialization format attempts to be as informative as possible while avoiding the export of potentially sensitive data. The number of serialized arguments depends on the specific command, see the configuration +list in `@opentelemetry/redis-common`. It is also possible to define a custom serialization function. The function will receive the command name and arguments and must return a string. -Here is a simple example to serialize the command name and arguments: +Here is a simple example to serialize the command name and all command arguments. +Notice that it might capture sensitive data and big payloads: ```javascript const { RedisInstrumentation } = require('@opentelemetry/instrumentation-redis'); diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/package.json b/plugins/node/opentelemetry-instrumentation-redis-4/package.json index 08b95f8103..d4284e0568 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis-4/package.json @@ -71,6 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/redis-common": "^0.33.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis-4#readme" diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts index b73d86c5f4..b4b229f66f 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts @@ -28,7 +28,8 @@ import { InstrumentationNodeModuleDefinition, InstrumentationNodeModuleFile, } from '@opentelemetry/instrumentation'; -import { defaultDbStatementSerializer, getClientAttributes } from './utils'; +import { getClientAttributes } from './utils'; +import { defaultDbStatementSerializer } from '@opentelemetry/redis-common'; import { RedisInstrumentationConfig } from './types'; import { VERSION } from './version'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/src/utils.ts b/plugins/node/opentelemetry-instrumentation-redis-4/src/utils.ts index 168bb2f36c..f102606474 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/src/utils.ts @@ -13,15 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { DbStatementSerializer } from './types'; import { DbSystemValues, SemanticAttributes, } from '@opentelemetry/semantic-conventions'; -export const defaultDbStatementSerializer: DbStatementSerializer = cmdName => - cmdName; - export function getClientAttributes(options: any) { return { [SemanticAttributes.DB_SYSTEM]: DbSystemValues.REDIS, diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts b/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts index ffbec97a85..615572cf5a 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/test/redis.test.ts @@ -99,7 +99,7 @@ describe('redis@^4.0.0', () => { ); assert.strictEqual( setSpan?.attributes[SemanticAttributes.DB_STATEMENT], - 'SET' + 'SET key [1 other arguments]' ); assert.strictEqual( setSpan?.attributes[SemanticAttributes.NET_PEER_NAME], @@ -124,7 +124,7 @@ describe('redis@^4.0.0', () => { ); assert.strictEqual( getSpan?.attributes[SemanticAttributes.DB_STATEMENT], - 'GET' + 'GET key' ); assert.strictEqual( getSpan?.attributes[SemanticAttributes.NET_PEER_NAME], @@ -149,7 +149,7 @@ describe('redis@^4.0.0', () => { assert.ok(setSpan); assert.strictEqual( setSpan?.attributes[SemanticAttributes.DB_STATEMENT], - 'SET' + 'SET key [1 other arguments]' ); assert.strictEqual( setSpan?.attributes[SemanticAttributes.NET_PEER_NAME], @@ -253,7 +253,7 @@ describe('redis@^4.0.0', () => { assert.strictEqual(multiSetSpan.name, 'redis-SET'); assert.strictEqual( multiSetSpan.attributes[SemanticAttributes.DB_STATEMENT], - 'SET' + 'SET key [1 other arguments]' ); assert.strictEqual( multiSetSpan?.attributes[SemanticAttributes.NET_PEER_NAME], @@ -272,7 +272,7 @@ describe('redis@^4.0.0', () => { assert.strictEqual(multiGetSpan.name, 'redis-GET'); assert.strictEqual( multiGetSpan.attributes[SemanticAttributes.DB_STATEMENT], - 'GET' + 'GET another-key' ); assert.strictEqual( multiGetSpan?.attributes[SemanticAttributes.NET_PEER_NAME], @@ -299,7 +299,7 @@ describe('redis@^4.0.0', () => { assert.ok(multiSetSpan); assert.strictEqual( multiSetSpan.attributes[SemanticAttributes.DB_STATEMENT], - 'SET' + 'SET key [1 other arguments]' ); assert.strictEqual( multiSetSpan?.attributes[SemanticAttributes.NET_PEER_NAME], diff --git a/plugins/node/opentelemetry-instrumentation-redis/README.md b/plugins/node/opentelemetry-instrumentation-redis/README.md index 4386a95da7..cf8aae670f 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/README.md +++ b/plugins/node/opentelemetry-instrumentation-redis/README.md @@ -55,14 +55,14 @@ Redis instrumentation has a few options available to choose from. You can set th #### Custom `db.statement` Serializer -The instrumentation serializes the command into a Span attribute called -`db.statement`. The default serialization sets the attribute to the command -name, without the command arguments. +The instrumentation serializes the command into a Span attribute called `db.statement`. The standard serialization format attempts to be as informative as possible while avoiding the export of potentially sensitive data. The number of serialized arguments depends on the specific command, see the configuration +list in `@opentelemetry/redis-common`. It is also possible to define a custom serialization function. The function will receive the command name and arguments and must return a string. -Here is a simple example to serialize the command name and arguments: +Here is a simple example to serialize the command name and all command arguments. +Notice that it might capture sensitive data and big payloads: ```javascript const { RedisInstrumentation } = require('@opentelemetry/instrumentation-redis'); diff --git a/plugins/node/opentelemetry-instrumentation-redis/package.json b/plugins/node/opentelemetry-instrumentation-redis/package.json index 0d34a57604..f0a9046162 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/package.json @@ -71,6 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", + "@opentelemetry/redis-common": "^0.33.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/redis": "2.8.31" }, diff --git a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts index 29b2e34f95..988c5c1a0f 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/src/utils.ts @@ -24,11 +24,7 @@ import { trace, diag, } from '@opentelemetry/api'; -import { - DbStatementSerializer, - RedisCommand, - RedisInstrumentationConfig, -} from './types'; +import { RedisCommand, RedisInstrumentationConfig } from './types'; import { EventEmitter } from 'events'; import { RedisInstrumentation } from './'; import { @@ -37,6 +33,7 @@ import { } from '@opentelemetry/semantic-conventions'; import { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation'; import { RedisPluginClientTypes } from './internal-types'; +import { defaultDbStatementSerializer } from '@opentelemetry/redis-common'; const endSpan = (span: Span, err?: Error | null) => { if (err) { @@ -75,8 +72,6 @@ export const getTracedCreateStreamTrace = ( }; }; -const defaultDbStatementSerializer: DbStatementSerializer = cmdName => cmdName; - export const getTracedInternalSendCommand = ( tracer: Tracer, original: Function, diff --git a/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts b/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts index 09842809fc..01d449a57e 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/test/redis.test.ts @@ -133,12 +133,14 @@ describe('redis@2.x', () => { description: string; command: string; args: string[]; + expectedDbStatement: string; method: (cb: redisTypes.Callback) => unknown; }> = [ { description: 'insert', command: 'hset', args: ['hash', 'random', 'random'], + expectedDbStatement: 'hash random [1 other arguments]', method: (cb: redisTypes.Callback) => client.hset('hash', 'random', 'random', cb), }, @@ -146,6 +148,7 @@ describe('redis@2.x', () => { description: 'get', command: 'get', args: ['test'], + expectedDbStatement: 'test', method: (cb: redisTypes.Callback) => client.get('test', cb), }, @@ -153,6 +156,7 @@ describe('redis@2.x', () => { description: 'delete', command: 'del', args: ['test'], + expectedDbStatement: 'test', method: (cb: redisTypes.Callback) => client.del('test', cb), }, ]; @@ -188,7 +192,7 @@ describe('redis@2.x', () => { it(`should create a child span for ${operation.description}`, done => { const attributes = { ...DEFAULT_ATTRIBUTES, - [SemanticAttributes.DB_STATEMENT]: operation.command, + [SemanticAttributes.DB_STATEMENT]: `${operation.command} ${operation.expectedDbStatement}`, }; const span = tracer.startSpan('test span'); context.with(trace.setSpan(context.active(), span), () => { diff --git a/release-please-config.json b/release-please-config.json index 6894b5d84d..424fe6824a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -17,6 +17,7 @@ "packages/opentelemetry-host-metrics": {}, "packages/opentelemetry-id-generator-aws-xray": {}, "packages/opentelemetry-propagation-utils": {}, + "packages/opentelemetry-redis-common": {}, "packages/opentelemetry-test-utils": {}, "plugins/node/instrumentation-amqplib": {}, "plugins/node/instrumentation-dataloader": {}, From 8a375f59f3043a7d3749b1e8af5603b9ed30f08f Mon Sep 17 00:00:00 2001 From: Ethan Resnick Date: Wed, 30 Nov 2022 11:53:35 -0800 Subject: [PATCH 11/91] fix: pg span names (#1306) * refactor(pg): more defensive, DRYer implementation The prior code had three different utility functions for constructing the span to use to trace the query: handleTextQuery, handleConfigQuery, and handleParameterizedQuery. These functions contained a lot of duplicated logic, and that duplication was gonna make it harder to introduce new features (see next commit) and was already leading to bugs/inconsistencies. For example, `handleConfigQuery` would verify that the parameter `values` provided with the query were provided as an array before attaching them to the span, whereas `handleParameterizedQuery` would do so without this validation. This commit instead normalizes the arguments to `client.query` first, so that only function is needed to create the span. In the process of normalizing the arguments, the new code also performs a bit more validation on them, to make sure that the instrumentation will not throw at runtime. For example, the prior code would've thrown on `client.query(null)`, as it was checking `typeof args[0] === 'object'` without excluding null. The prior code also assumed, if an object was passed, that the `text` and `name` keys held a string; this is now verified before attaching that data to the span. Finally, the prior code had two different code paths for invoking the original `client.query` method; one that went through `handleInvalidQuery` and one directly in `_getClientQueryPatch`. The former wrapped the call in a try-catch, while the latter did not. Now, there's only one call to the original client.query, and it's always in a try-catch, which ensures that other cases of invalid args passed to client.query (which might lead it to throw synchronously) won't be an issue. * refactor(pg): dry up attribute generation * fix(pg): spec-compliant span naming BREAKING CHANGE. This improves the way that OTEL span names are generated in two different ways. First, if the query is a prepared statement with a `name`, the `name` is put into the span name as-is. Before, the `name` was transformed first, as though it were a full SQL query string (i.e., it was split on spaces and only the first 'word' was used). Second, when we do only have a full query string, and we take the first word to form the span name, the code now calls `toUpperCase()` on that string, so that a `select * from x` and a `SELECT * from x` query both end up with a span name like `pg.query:SELECT`. * test(pg): more error handling tests --- .../src/instrumentation.ts | 150 +++++++------ .../src/internal-types.ts | 6 - .../src/utils.ts | 202 +++++++++--------- .../test/pg.test.ts | 20 ++ .../test/utils.test.ts | 98 +++++---- 5 files changed, 248 insertions(+), 228 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts index f309555951..f70e39f671 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts @@ -26,7 +26,6 @@ import { PgClientConnect, PgClientExtended, PgErrorCallback, - NormalizedQueryConfig, PostgresCallback, PgPoolExtended, PgPoolCallback, @@ -137,12 +136,7 @@ export class PgInstrumentation extends InstrumentationBase { `${PgInstrumentation.COMPONENT}.connect`, { [SemanticAttributes.DB_SYSTEM]: DbSystemValues.POSTGRESQL, - [SemanticAttributes.DB_NAME]: this.database, - [SemanticAttributes.NET_PEER_NAME]: this.host, - [SemanticAttributes.DB_CONNECTION_STRING]: - utils.getConnectionString(this), - [SemanticAttributes.NET_PEER_PORT]: this.port, - [SemanticAttributes.DB_USER]: this.user, + ...utils.getSemanticAttributesFromConnection(this), } ); @@ -173,72 +167,70 @@ export class PgInstrumentation extends InstrumentationBase { `Patching ${PgInstrumentation.COMPONENT}.Client.prototype.query` ); return function query(this: PgClientExtended, ...args: unknown[]) { - let span: Span; + // client.query(text, cb?), client.query(text, values, cb?), and + // client.query(configObj, cb?) are all valid signatures. We construct + // a queryConfig obj from all (valid) signatures to build the span in a + // unified way. We verify that we at least have query text, and code + // defensively when dealing with `queryConfig` after that (to handle all + // the other invalid cases, like a non-array for values being provided). + // The type casts here reflect only what we've actually validated. + const arg0 = args[0]; + const firstArgIsString = typeof arg0 === 'string'; + const firstArgIsQueryObjectWithText = + utils.isObjectWithTextString(arg0); + + // TODO: remove the `as ...` casts below when the TS version is upgraded. + // Newer TS versions will use the result of firstArgIsQueryObjectWithText + // to properly narrow arg0, but TS 4.3.5 does not. + const queryConfig = firstArgIsString + ? { + text: arg0 as string, + values: Array.isArray(args[1]) ? args[1] : undefined, + } + : firstArgIsQueryObjectWithText + ? (arg0 as utils.ObjectWithText) + : undefined; - // Handle different client.query(...) signatures - if (typeof args[0] === 'string') { - const query = args[0]; + const instrumentationConfig = plugin.getConfig(); - if (args.length > 1 && args[1] instanceof Array) { - const params = args[1]; - span = utils.handleParameterizedQuery.call( - this, - plugin.tracer, - plugin.getConfig(), - query, - params - ); - } else { - span = utils.handleTextQuery.call( - this, - plugin.tracer, - plugin.getConfig(), - query - ); - } + const span = utils.handleConfigQuery.call( + this, + plugin.tracer, + instrumentationConfig, + queryConfig + ); - if (plugin.getConfig().addSqlCommenterCommentToQueries) { - // Modify the query with a tracing comment - args[0] = utils.addSqlCommenterComment(span, args[0]); - } - } else if (typeof args[0] === 'object') { - const queryConfig = args[0] as NormalizedQueryConfig; - - span = utils.handleConfigQuery.call( - this, - plugin.tracer, - plugin.getConfig(), - queryConfig - ); - - if (plugin.getConfig().addSqlCommenterCommentToQueries) { - // Copy the query config instead of writing to args[0].text so that we don't modify user's - // original query config reference - args[0] = { - ...queryConfig, - text: utils.addSqlCommenterComment(span, queryConfig.text), - }; - } - } else { - return utils.handleInvalidQuery.call( - this, - plugin.tracer, - plugin.getConfig(), - original, - ...args - ); + // Modify query text w/ a tracing comment before invoking original for + // tracing, but only if args[0] has one of our expected shapes. + // + // TODO: remove the `as ...` casts below when the TS version is upgraded. + // Newer TS versions will use the result of firstArgIsQueryObjectWithText + // to properly narrow arg0, but TS 4.3.5 does not. + if (instrumentationConfig.addSqlCommenterCommentToQueries) { + args[0] = firstArgIsString + ? utils.addSqlCommenterComment(span, arg0 as string) + : firstArgIsQueryObjectWithText + ? { + ...(arg0 as utils.ObjectWithText), + text: utils.addSqlCommenterComment( + span, + (arg0 as utils.ObjectWithText).text + ), + } + : args[0]; } - // Bind callback to parent span + // Bind callback (if any) to parent span (if any) if (args.length > 0) { const parentSpan = trace.getSpan(context.active()); if (typeof args[args.length - 1] === 'function') { // Patch ParameterQuery callback args[args.length - 1] = utils.patchCallback( - plugin.getConfig(), + instrumentationConfig, span, - args[args.length - 1] as PostgresCallback + args[args.length - 1] as PostgresCallback // nb: not type safe. ); + // If a parent span exists, bind the callback if (parentSpan) { args[args.length - 1] = context.bind( @@ -246,28 +238,37 @@ export class PgInstrumentation extends InstrumentationBase { args[args.length - 1] ); } - } else if ( - typeof (args[0] as NormalizedQueryConfig).callback === 'function' - ) { + } else if (typeof queryConfig?.callback === 'function') { // Patch ConfigQuery callback let callback = utils.patchCallback( plugin.getConfig(), span, - (args[0] as NormalizedQueryConfig).callback! + queryConfig.callback as PostgresCallback // nb: not type safe. ); + // If a parent span existed, bind the callback if (parentSpan) { callback = context.bind(context.active(), callback); } - // Copy the callback instead of writing to args.callback so that we don't modify user's - // original callback reference + // Copy the callback instead of writing to args.callback so that we + // don't modify user's original callback reference args[0] = { ...(args[0] as object), callback }; } } - // Perform the original query - const result: unknown = original.apply(this, args as any); + let result: unknown; + try { + result = original.apply(this, args as never); + } catch (e: unknown) { + // span.recordException(e); + span.setStatus({ + code: SpanStatusCode.ERROR, + message: utils.getErrorMessage(e), + }); + span.end(); + throw e; + } // Bind promise to parent span and end the span if (result instanceof Promise) { @@ -302,7 +303,6 @@ export class PgInstrumentation extends InstrumentationBase { const plugin = this; return (originalConnect: typeof pgPoolTypes.prototype.connect) => { return function connect(this: PgPoolExtended, callback?: PgPoolCallback) { - const connString = utils.getConnectionString(this.options); // setup span const span = startSpan( plugin.tracer, @@ -310,11 +310,7 @@ export class PgInstrumentation extends InstrumentationBase { `${PG_POOL_COMPONENT}.connect`, { [SemanticAttributes.DB_SYSTEM]: DbSystemValues.POSTGRESQL, - [SemanticAttributes.DB_NAME]: this.options.database, // required - [SemanticAttributes.NET_PEER_NAME]: this.options.host, // required - [SemanticAttributes.DB_CONNECTION_STRING]: connString, // required - [SemanticAttributes.NET_PEER_PORT]: this.options.port, - [SemanticAttributes.DB_USER]: this.options.user, + ...utils.getSemanticAttributesFromConnection(this.options), [AttributeNames.IDLE_TIMEOUT_MILLIS]: this.options.idleTimeoutMillis, [AttributeNames.MAX_CLIENT]: this.options.maxClient, @@ -359,10 +355,10 @@ function handleConnectResult(span: Span, connectResult: unknown) { span.end(); return result; }) - .catch((error: Error) => { + .catch((error: unknown) => { span.setStatus({ code: SpanStatusCode.ERROR, - message: error.message, + message: utils.getErrorMessage(error), }); span.end(); return Promise.reject(error); diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts b/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts index dc4e54fe7a..60b2377bc9 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts @@ -32,12 +32,6 @@ export interface PgClientExtended extends pgTypes.Client { connectionParameters: PgClientConnectionParams; } -// Interface name based on original driver implementation -// https://github.com/brianc/node-postgres/blob/2ef55503738eb2cbb6326744381a92c0bc0439ab/packages/pg/lib/utils.js#L157 -export interface NormalizedQueryConfig extends pgTypes.QueryConfig { - callback?: PostgresCallback; -} - export type PgPoolCallback = ( err: Error, client: any, diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts index 048c0d7ad0..d5e74b714c 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts @@ -35,7 +35,6 @@ import { } from '@opentelemetry/semantic-conventions'; import { PgClientExtended, - NormalizedQueryConfig, PostgresCallback, PgClientConnectionParams, PgErrorCallback, @@ -51,20 +50,72 @@ function arrayStringifyHelper(arr: Array): string { return '[' + arr.toString() + ']'; } -// Helper function to get a low cardinality command name from the full text query -function getCommandFromText(text?: string): string { - if (!text) return 'unknown'; - const words = text.split(' '); - return words[0].length > 0 ? words[0] : 'unknown'; +/** + * Helper function to get a low cardinality span name from whatever info we have + * about the query. + * + * This is tricky, because we don't have most of the information (table name, + * operation name, etc) the spec recommends using to build a low-cardinality + * value w/o parsing. So, we use db.name and assume that, if the query's a named + * prepared statement, those `name` values will be low cardinality. If we don't + * have a named prepared statement, we try to parse an operation (despite the + * spec's warnings). + * + * @params dbName The name of the db against which this query is being issued, + * which could be missing if no db name was given at the time that the + * connection was established. + * @params queryConfig Information we have about the query being issued, typed + * to reflect only the validation we've actually done on the args to + * `client.query()`. This will be undefined if `client.query()` was called + * with invalid arguments. + */ +export function getQuerySpanName( + dbName: string | undefined, + queryConfig?: { text: string; name?: unknown } +) { + // NB: when the query config is invalid, we omit the dbName too, so that + // someone (or some tool) reading the span name doesn't misinterpret the + // dbName as being a prepared statement or sql commit name. + if (!queryConfig) return PgInstrumentation.BASE_SPAN_NAME; + + // Either the name of a prepared statement; or an attempted parse + // of the SQL command, normalized to uppercase; or unknown. + const command = + typeof queryConfig.name === 'string' && queryConfig.name + ? queryConfig.name + : parseNormalizedOperationName(queryConfig.text); + + return `${PgInstrumentation.BASE_SPAN_NAME}:${command}${ + dbName ? ` ${dbName}` : '' + }`; +} + +function parseNormalizedOperationName(queryText: string) { + const sqlCommand = queryText.split(' ')[0].toUpperCase(); + + // Handle query text being "COMMIT;", which has an extra semicolon before the space. + return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand; } -export function getConnectionString(params: PgClientConnectionParams) { +function getConnectionString(params: PgClientConnectionParams) { const host = params.host || 'localhost'; const port = params.port || 5432; const database = params.database || ''; return `postgresql://${host}:${port}/${database}`; } +export function getSemanticAttributesFromConnection( + params: PgClientConnectionParams +) { + return { + [SemanticAttributes.DB_NAME]: params.database, // required + [SemanticAttributes.DB_CONNECTION_STRING]: getConnectionString(params), // required + [SemanticAttributes.NET_PEER_NAME]: params.host, // required + [SemanticAttributes.NET_PEER_PORT]: params.port, + [SemanticAttributes.DB_USER]: params.user, + }; +} + export function startSpan( tracer: Tracer, instrumentationConfig: PgInstrumentationConfig, @@ -85,127 +136,51 @@ export function startSpan( }); } -// Private helper function to start a span after a connection has been established -function startQuerySpan( - client: PgClientExtended, +// Create a span from our normalized queryConfig object, +// or return a basic span if no queryConfig was given/could be created. +export function handleConfigQuery( + this: PgClientExtended, tracer: Tracer, instrumentationConfig: PgInstrumentationConfig, - name: string + queryConfig?: { text: string; values?: unknown; name?: unknown } ) { - const jdbcString = getConnectionString(client.connectionParameters); - return startSpan(tracer, instrumentationConfig, name, { - [SemanticAttributes.DB_NAME]: client.connectionParameters.database, // required + // Create child span. + const { connectionParameters } = this; + const dbName = connectionParameters.database; + + const spanName = getQuerySpanName(dbName, queryConfig); + const span = startSpan(tracer, instrumentationConfig, spanName, { [SemanticAttributes.DB_SYSTEM]: DbSystemValues.POSTGRESQL, // required - [SemanticAttributes.DB_CONNECTION_STRING]: jdbcString, // required - [SemanticAttributes.NET_PEER_NAME]: client.connectionParameters.host, // required - [SemanticAttributes.NET_PEER_PORT]: client.connectionParameters.port, - [SemanticAttributes.DB_USER]: client.connectionParameters.user, + ...getSemanticAttributesFromConnection(connectionParameters), }); -} -// Queries where args[0] is a QueryConfig -export function handleConfigQuery( - this: PgClientExtended, - tracer: Tracer, - instrumentationConfig: PgInstrumentationConfig, - queryConfig: NormalizedQueryConfig -) { - // Set child span name - const queryCommand = getCommandFromText(queryConfig.name || queryConfig.text); - const name = PgInstrumentation.BASE_SPAN_NAME + ':' + queryCommand; - const span = startQuerySpan(this, tracer, instrumentationConfig, name); + if (!queryConfig) { + return span; + } // Set attributes if (queryConfig.text) { span.setAttribute(SemanticAttributes.DB_STATEMENT, queryConfig.text); } + if ( instrumentationConfig.enhancedDatabaseReporting && - queryConfig.values instanceof Array + Array.isArray(queryConfig.values) ) { span.setAttribute( AttributeNames.PG_VALUES, arrayStringifyHelper(queryConfig.values) ); } + // Set plan name attribute, if present - if (queryConfig.name) { + if (typeof queryConfig.name === 'string') { span.setAttribute(AttributeNames.PG_PLAN, queryConfig.name); } return span; } -// Queries where args[1] is a 'values' array -export function handleParameterizedQuery( - this: PgClientExtended, - tracer: Tracer, - instrumentationConfig: PgInstrumentationConfig, - query: string, - values: unknown[] -) { - // Set child span name - const queryCommand = getCommandFromText(query); - const name = PgInstrumentation.BASE_SPAN_NAME + ':' + queryCommand; - const span = startQuerySpan(this, tracer, instrumentationConfig, name); - - // Set attributes - span.setAttribute(SemanticAttributes.DB_STATEMENT, query); - if (instrumentationConfig.enhancedDatabaseReporting) { - span.setAttribute(AttributeNames.PG_VALUES, arrayStringifyHelper(values)); - } - - return span; -} - -// Queries where args[0] is a text query and 'values' was not specified -export function handleTextQuery( - this: PgClientExtended, - tracer: Tracer, - instrumentationConfig: PgInstrumentationConfig, - query: string -) { - // Set child span name - const queryCommand = getCommandFromText(query); - const name = PgInstrumentation.BASE_SPAN_NAME + ':' + queryCommand; - const span = startQuerySpan(this, tracer, instrumentationConfig, name); - - // Set attributes - span.setAttribute(SemanticAttributes.DB_STATEMENT, query); - - return span; -} - -/** - * Invalid query handler. We should never enter this function unless invalid args were passed to the driver. - * Create and immediately end a new span - */ -export function handleInvalidQuery( - this: PgClientExtended, - tracer: Tracer, - instrumentationConfig: PgInstrumentationConfig, - originalQuery: typeof pgTypes.Client.prototype.query, - ...args: unknown[] -) { - let result; - const span = startQuerySpan( - this, - tracer, - instrumentationConfig, - PgInstrumentation.BASE_SPAN_NAME - ); - try { - result = originalQuery.apply(this, args as never); - } catch (e) { - // span.recordException(e); - span.setStatus({ code: SpanStatusCode.ERROR, message: e.message }); - throw e; - } finally { - span.end(); - } - return result; -} - export function handleExecutionResult( config: PgInstrumentationConfig, span: Span, @@ -358,3 +333,26 @@ export function addSqlCommenterComment(span: Span, query: string): string { return `${query} /*${commentString}*/`; } + +/** + * Attempt to get a message string from a thrown value, while being quite + * defensive, to recognize the fact that, in JS, any kind of value (even + * primitives) can be thrown. + */ +export function getErrorMessage(e: unknown) { + return typeof e === 'object' && e !== null && 'message' in e + ? String((e as { message?: unknown }).message) + : undefined; +} + +export function isObjectWithTextString(it: unknown): it is ObjectWithText { + return ( + typeof it === 'object' && + typeof (it as null | { text?: unknown })?.text === 'string' + ); +} + +export type ObjectWithText = { + text: string; + [k: string]: unknown; +}; diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts index e91b0034fb..be8e1491cf 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts @@ -203,6 +203,26 @@ describe('pg', () => { runCallbackTest(null, DEFAULT_ATTRIBUTES, [], errorStatus); memoryExporter.reset(); + assert.throws( + () => { + (client as any).query(null); + }, + assertPgError, + 'pg should throw when null provided as only arg' + ); + runCallbackTest(null, DEFAULT_ATTRIBUTES, [], errorStatus); + memoryExporter.reset(); + + assert.throws( + () => { + (client as any).query(undefined); + }, + assertPgError, + 'pg should throw when undefined provided as only arg' + ); + runCallbackTest(null, DEFAULT_ATTRIBUTES, [], errorStatus); + memoryExporter.reset(); + assert.doesNotThrow( () => (client as any).query({ foo: 'bar' }, undefined, () => { diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts index 4b43e4da95..099ffa3bf4 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/utils.test.ts @@ -33,7 +33,7 @@ import * as assert from 'assert'; import * as pg from 'pg'; import { PgInstrumentationConfig } from '../src'; import { AttributeNames } from '../src/enums/AttributeNames'; -import { PgClientExtended, NormalizedQueryConfig } from '../src/internal-types'; +import { PgClientExtended } from '../src/internal-types'; import * as utils from '../src/utils'; const memoryExporter = new InMemorySpanExporter(); @@ -75,6 +75,59 @@ describe('utils.ts', () => { context.disable(); }); + describe('.getQuerySpanName()', () => { + const dummyQuery = { + text: 'SELECT $1', + values: ['hello'], + name: 'select-placeholder-val', + }; + + it('uses prepared statement name when given, over query text', () => { + assert.strictEqual( + utils.getQuerySpanName('dbName', dummyQuery), + 'pg.query:select-placeholder-val dbName' + ); + }); + + it('falls back to parsing query text when no (valid) name is available', () => { + assert.strictEqual( + utils.getQuerySpanName('dbName', { ...dummyQuery, name: undefined }), + 'pg.query:SELECT dbName' + ); + }); + + it('normalizes operation names parsed from query text', () => { + const queryUpperCase = { text: dummyQuery.text.toUpperCase() }; + const queryLowerCase = { text: dummyQuery.text.toLowerCase() }; + + assert.strictEqual( + utils.getQuerySpanName('dbName', queryUpperCase), + utils.getQuerySpanName('dbName', queryLowerCase) + ); + }); + + it('ignores trailing semicolons when parsing operation names', () => { + assert.strictEqual( + utils.getQuerySpanName('dbName', { text: 'COMMIT;' }), + 'pg.query:COMMIT dbName' + ); + }); + + it('omits db name if missing', () => { + assert.strictEqual( + utils.getQuerySpanName(undefined, dummyQuery), + 'pg.query:select-placeholder-val' + ); + }); + + it('should omit all info if the queryConfig is invalid', () => { + assert.strictEqual( + utils.getQuerySpanName('db-name-ignored', undefined), + 'pg.query' + ); + }); + }); + describe('.startSpan()', () => { it('starts real span when requireParentSpan=false', async () => { const span = utils.startSpan(tracer, instrumentationConfig, 'spanName', { @@ -131,7 +184,7 @@ describe('utils.ts', () => { }); describe('.handleConfigQuery()', () => { - const queryConfig: NormalizedQueryConfig = { + const queryConfig = { text: 'SELECT $1::text', values: ['0'], }; @@ -171,47 +224,6 @@ describe('utils.ts', () => { }); }); - describe('.handleParameterizedQuery()', () => { - const query = 'SELECT $1::text'; - const values = ['0']; - - it('does not track pg.values by default', async () => { - const querySpan = utils.handleParameterizedQuery.call( - client, - tracer, - instrumentationConfig, - query, - values - ); - querySpan.end(); - - const readableSpan = getLatestSpan(); - - const pgValues = readableSpan.attributes[AttributeNames.PG_VALUES]; - assert.strictEqual(pgValues, undefined); - }); - - it('tracks pg.values if enabled explicitly', async () => { - const extPluginConfig: PgInstrumentationConfig & InstrumentationConfig = { - ...instrumentationConfig, - enhancedDatabaseReporting: true, - }; - const querySpan = utils.handleParameterizedQuery.call( - client, - tracer, - extPluginConfig, - query, - values - ); - querySpan.end(); - - const readableSpan = getLatestSpan(); - - const pgValues = readableSpan.attributes[AttributeNames.PG_VALUES]; - assert.strictEqual(pgValues, '[0]'); - }); - }); - describe('addSqlCommenterComment', () => { it('adds comment to a simple query', () => { const spanContext: SpanContext = { From f0a93685cfb43543b7ca577dd370d56576b49e3f Mon Sep 17 00:00:00 2001 From: Ethan Resnick Date: Wed, 30 Nov 2022 21:08:54 -0800 Subject: [PATCH 12/91] feat(pg): support requestHook hook (#1307) --- .../README.md | 3 +- .../package.json | 1 + .../src/instrumentation.ts | 45 +++++++++ .../src/internal-types.ts | 16 +++- .../src/types.ts | 29 +++++- .../src/utils.ts | 6 +- .../test/pg.test.ts | 95 +++++++++++++++++++ 7 files changed, 186 insertions(+), 9 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-pg/README.md b/plugins/node/opentelemetry-instrumentation-pg/README.md index b14e036343..3703143057 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/README.md +++ b/plugins/node/opentelemetry-instrumentation-pg/README.md @@ -47,7 +47,8 @@ PostgreSQL instrumentation has few options available to choose from. You can set | Options | Type | Description | | ------- | ---- | ----------- | | [`enhancedDatabaseReporting`](./src/types.ts#L30) | `boolean` | If true, additional information about query parameters and results will be attached (as `attributes`) to spans representing database operations | -| `responseHook` | `PgInstrumentationExecutionResponseHook` (function) | Function for adding custom attributes from db response | +| `requestHook` | `PgInstrumentationExecutionRequestHook` (function) | Function for adding custom span attributes using information about the query being issued and the db to which it's directed | +| `responseHook` | `PgInstrumentationExecutionResponseHook` (function) | Function for adding custom span attributes from db response | | `requireParentSpan` | `boolean` | If true, requires a parent span to create new spans (default false) | | `addSqlCommenterCommentToQueries` | `boolean` | If true, adds [sqlcommenter](https://github.com/open-telemetry/opentelemetry-sqlcommenter) specification compliant comment to queries with tracing context (default false). _NOTE: A comment will not be added to queries that already contain `--` or `/* ... */` in them, even if these are not actually part of comments_ | diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index fdf69fe8be..d3d4e2de1b 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -68,6 +68,7 @@ "pg": "8.7.1", "pg-pool": "3.4.1", "rimraf": "3.0.2", + "safe-stable-stringify": "^2.4.1", "sinon": "14.0.0", "test-all-versions": "5.0.1", "ts-mocha": "10.0.0", diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts index f70e39f671..e41ce010ae 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts @@ -17,6 +17,7 @@ import { isWrapped, InstrumentationBase, InstrumentationNodeModuleDefinition, + safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { context, diag, trace, Span, SpanStatusCode } from '@opentelemetry/api'; @@ -257,6 +258,50 @@ export class PgInstrumentation extends InstrumentationBase { } } + if ( + typeof instrumentationConfig.requestHook === 'function' && + queryConfig + ) { + safeExecuteInTheMiddle( + () => { + // pick keys to expose explicitly, so we're not leaking pg package + // internals that are subject to change + const { database, host, port, user } = this.connectionParameters; + const connection = { database, host, port, user }; + + instrumentationConfig.requestHook!(span, { + connection, + query: { + text: queryConfig.text, + // nb: if `client.query` is called with illegal arguments + // (e.g., if `queryConfig.values` is passed explicitly, but a + // non-array is given), then the type casts will be wrong. But + // we leave it up to the queryHook to handle that, and we + // catch and swallow any errors it throws. The other options + // are all worse. E.g., we could leave `queryConfig.values` + // and `queryConfig.name` as `unknown`, but then the hook body + // would be forced to validate (or cast) them before using + // them, which seems incredibly cumbersome given that these + // casts will be correct 99.9% of the time -- and pg.query + // will immediately throw during development in the other .1% + // of cases. Alternatively, we could simply skip calling the + // hook when `values` or `name` don't have the expected type, + // but that would add unnecessary validation overhead to every + // hook invocation and possibly be even more confusing/unexpected. + values: queryConfig.values as unknown[], + name: queryConfig.name as string | undefined, + }, + }); + }, + err => { + if (err) { + plugin._diag.error('Error running query hook', err); + } + }, + true + ); + } + let result: unknown; try { result = original.apply(this, args as never); diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts b/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts index 60b2377bc9..546d84b9ee 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/internal-types.ts @@ -19,9 +19,17 @@ import type * as pgPoolTypes from 'pg-pool'; export type PostgresCallback = (err: Error, res: object) => unknown; -// These are not included in @types/pg, so manually define them. -// https://github.com/brianc/node-postgres/blob/fde5ec586e49258dfc4a2fcd861fcdecb4794fc3/lib/client.js#L25 -export interface PgClientConnectionParams { +// NB: this type describes the shape of a parsed, normalized form of the +// connection information that's stored inside each pg.Client instance. It's +// _not_ the same as the ConnectionConfig type exported from `@types/pg`. That +// type defines how data must be _passed in_ when creating a new `pg.Client`, +// which doesn't necessarily match the normalized internal form. E.g., a user +// can call `new Client({ connectionString: '...' }), but `connectionString` +// will never show up in the type below, because only the extracted host, port, +// etc. are recorded in this normalized config. The keys listed below are also +// incomplete, which is fine because the type is internal and these keys are the +// only ones our code is reading. See https://github.com/brianc/node-postgres/blob/fde5ec586e49258dfc4a2fcd861fcdecb4794fc3/lib/client.js#L25 +export interface PgParsedConnectionParams { database?: string; host?: string; port?: number; @@ -29,7 +37,7 @@ export interface PgClientConnectionParams { } export interface PgClientExtended extends pgTypes.Client { - connectionParameters: PgClientConnectionParams; + connectionParameters: PgParsedConnectionParams; } export type PgPoolCallback = ( diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/types.ts b/plugins/node/opentelemetry-instrumentation-pg/src/types.ts index 3e0d280cad..1c9a7da2c6 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/types.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/types.ts @@ -26,12 +26,39 @@ export interface PgInstrumentationExecutionResponseHook { (span: api.Span, responseInfo: PgResponseHookInformation): void; } +export interface PgRequestHookInformation { + query: { + text: string; + name?: string; + values?: unknown[]; + }; + connection: { + database?: string; + host?: string; + port?: number; + user?: string; + }; +} + +export interface PgInstrumentationExecutionRequestHook { + (span: api.Span, queryInfo: PgRequestHookInformation): void; +} + export interface PgInstrumentationConfig extends InstrumentationConfig { /** - * If true, additional information about query parameters will be attached (as `attributes`) to spans representing + * If true, an attribute containing the query's parameters will be attached + * the spans generated to represent the query. */ enhancedDatabaseReporting?: boolean; + /** + * Hook that allows adding custom span attributes or updating the + * span's name based on the data about the query to execute. + * + * @default undefined + */ + requestHook?: PgInstrumentationExecutionRequestHook; + /** * Hook that allows adding custom span attributes based on the data * returned from "query" Pg actions. diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts index d5e74b714c..3cc25d45eb 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts @@ -36,10 +36,10 @@ import { import { PgClientExtended, PostgresCallback, - PgClientConnectionParams, PgErrorCallback, PgPoolCallback, PgPoolExtended, + PgParsedConnectionParams, } from './internal-types'; import { PgInstrumentationConfig } from './types'; import type * as pgTypes from 'pg'; @@ -97,7 +97,7 @@ function parseNormalizedOperationName(queryText: string) { return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand; } -function getConnectionString(params: PgClientConnectionParams) { +export function getConnectionString(params: PgParsedConnectionParams) { const host = params.host || 'localhost'; const port = params.port || 5432; const database = params.database || ''; @@ -105,7 +105,7 @@ function getConnectionString(params: PgClientConnectionParams) { } export function getSemanticAttributesFromConnection( - params: PgClientConnectionParams + params: PgParsedConnectionParams ) { return { [SemanticAttributes.DB_NAME]: params.database, // required diff --git a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts index be8e1491cf..393da4ca0e 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts @@ -33,6 +33,7 @@ import { import * as assert from 'assert'; import type * as pg from 'pg'; import * as sinon from 'sinon'; +import stringify from 'safe-stable-stringify'; import { PgInstrumentation, PgInstrumentationConfig, @@ -513,6 +514,100 @@ describe('pg', () => { }); }); + describe('when specifying a requestHook configuration', () => { + const dataAttributeName = 'pg_data'; + const query = 'SELECT 0::text'; + const events: TimedEvent[] = []; + + // these are the attributes that we'd expect would end up on the final + // span if there is no requestHook. + const attributes = { + ...DEFAULT_ATTRIBUTES, + [SemanticAttributes.DB_STATEMENT]: query, + }; + + // These are the attributes we expect on the span after the requestHook + // has run. We set up the hook to just add to the span a stringified + // version of the args it receives (which is an easy way to assert both + // that the proper args were passed and that the hook was called). + const attributesAfterHook = { + ...attributes, + [dataAttributeName]: stringify({ + connection: { + database: CONFIG.database, + port: CONFIG.port, + host: CONFIG.host, + user: CONFIG.user, + }, + query: { text: query }, + }), + }; + + describe('AND valid requestHook', () => { + beforeEach(async () => { + create({ + enhancedDatabaseReporting: true, + requestHook: (span, requestInfo) => { + span.setAttribute(dataAttributeName, stringify(requestInfo)); + }, + }); + }); + + it('should attach request hook data to resulting spans for query with callback ', done => { + const span = tracer.startSpan('test span'); + context.with(trace.setSpan(context.active(), span), () => { + const res = client.query(query, (err, res) => { + assert.strictEqual(err, null); + assert.ok(res); + runCallbackTest(span, attributesAfterHook, events); + done(); + }); + assert.strictEqual(res, undefined, 'No promise is returned'); + }); + }); + + it('should attach request hook data to resulting spans for query returning a Promise', async () => { + const span = tracer.startSpan('test span'); + await context.with( + trace.setSpan(context.active(), span), + async () => { + const resPromise = await client.query({ text: query }); + try { + assert.ok(resPromise); + runCallbackTest(span, attributesAfterHook, events); + } catch (e) { + assert.ok(false, e.message); + } + } + ); + }); + }); + + describe('AND invalid requestHook', () => { + beforeEach(async () => { + create({ + enhancedDatabaseReporting: true, + requestHook: (_span, _requestInfo) => { + throw 'some kind of failure!'; + }, + }); + }); + + it('should not do any harm when throwing an exception', done => { + const span = tracer.startSpan('test span'); + context.with(trace.setSpan(context.active(), span), () => { + const res = client.query(query, (err, res) => { + assert.strictEqual(err, null); + assert.ok(res); + runCallbackTest(span, attributes, events); + done(); + }); + assert.strictEqual(res, undefined, 'No promise is returned'); + }); + }); + }); + }); + describe('when specifying a responseHook configuration', () => { const dataAttributeName = 'pg_data'; const query = 'SELECT 0::text'; From 912cde18e271dccc99e9b46f8bc684d5d9808a91 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Thu, 8 Dec 2022 10:37:23 +0200 Subject: [PATCH 13/91] ci: skip a broken aws-sdk version in TAV (#1319) --- plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml b/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml index 4e23df61dc..d905375e40 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml @@ -1,21 +1,21 @@ "aws-sdk": # there are so many version to test, it can take forever. # we will just sample few of them - versions: ">=2.1230.0 || 2.1219.0 || 2.1152.0 || 2.1048.0 || 2.1012.0 || 2.647.0 || 2.308.0" + versions: ">=2.1266.0 || 2.1262.0 || 2.1219.0 || 2.1048.0 || 2.1012.0 || 2.647.0 || 2.308.0" commands: - npm run test # Fix missing `contrib-test-utils` package pretest: npm run --prefix ../../../ lerna:link "@aws-sdk/client-s3": - versions: ">=3.188.0 || 3.154.0 || 3.107.0 || 3.54.0 || 3.6.1" + versions: ">=3.223.0 || 3.218.0 || 3.216.0 || 3.154.0 || 3.107.0 || 3.54.0 || 3.6.1" commands: - npm run test # Fix missing `contrib-test-utils` package pretest: npm run --prefix ../../../ lerna:link "@aws-sdk/client-sqs": - versions: ">=3.188.0 || 3.171.0 || 3.107.0 || 3.58.0 || 3.54.0 || 3.43.0 || 3.24.0" + versions: ">=3.216.0 || 3.171.0 || 3.58.0 || 3.54.0 || 3.43.0 || 3.24.0" commands: - npm run test # Fix missing `contrib-test-utils` package From 97305e1880ecbfb3b87d6c38f0c6521570583510 Mon Sep 17 00:00:00 2001 From: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com> Date: Sun, 11 Dec 2022 11:28:55 +0200 Subject: [PATCH 14/91] feat(mongodb): add db.operation span attribute (#1321) * chore(mongo): add DB_OPERATION attribute * chore(mongo): replace 'remove' with 'delete' * chore(mongo): add tests * chore(mongo): add condition in case cmd=unknown * chore(mongo): make code more readable --- .../examples/README.md | 4 +- .../src/instrumentation.ts | 30 ++++++--- .../test/mongodb-v3.test.ts | 63 +++++++++++++++---- .../test/mongodb-v4.test.ts | 63 +++++++++++++++---- .../test/utils.ts | 5 ++ 5 files changed, 127 insertions(+), 38 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/examples/README.md b/plugins/node/opentelemetry-instrumentation-mongodb/examples/README.md index d30fb9ed20..120f97fc84 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/examples/README.md +++ b/plugins/node/opentelemetry-instrumentation-mongodb/examples/README.md @@ -37,11 +37,11 @@ Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/ npm run zipkin:server ``` -- Run the zipkin:client +- Run the client ```sh # from this directory - npm run client + npm run zipkin:client ``` #### Zipkin UI diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts index f950dd49a8..8361de772c 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts @@ -210,7 +210,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { ns, server, // eslint-disable-next-line @typescript-eslint/no-explicit-any - ops[0] as any + ops[0] as any, + operationName ); const patchedCallback = instrumentation._patchEnd(span, resultHandler); // handle when options is the callback to send the correct number of args @@ -255,7 +256,9 @@ export class MongoDBInstrumentation extends InstrumentationBase { const span = instrumentation.tracer.startSpan(`mongodb.${type}`, { kind: SpanKind.CLIENT, }); - instrumentation._populateV3Attributes(span, ns, server, cmd); + const operation = + commandType === MongodbCommandType.UNKNOWN ? undefined : commandType; + instrumentation._populateV3Attributes(span, ns, server, cmd, operation); const patchedCallback = instrumentation._patchEnd(span, resultHandler); // handle when options is the callback to send the correct number of args if (typeof options === 'function') { @@ -296,7 +299,7 @@ export class MongoDBInstrumentation extends InstrumentationBase { kind: SpanKind.CLIENT, } ); - instrumentation._populateV4Attributes(span, this, ns, cmd); + instrumentation._populateV4Attributes(span, this, ns, cmd, commandType); const patchedCallback = instrumentation._patchEnd(span, resultHandler); return original.call(this, ns, cmd, options, patchedCallback); }; @@ -341,7 +344,7 @@ export class MongoDBInstrumentation extends InstrumentationBase { const span = instrumentation.tracer.startSpan('mongodb.find', { kind: SpanKind.CLIENT, }); - instrumentation._populateV3Attributes(span, ns, server, cmd); + instrumentation._populateV3Attributes(span, ns, server, cmd, 'find'); const patchedCallback = instrumentation._patchEnd(span, resultHandler); // handle when options is the callback to send the correct number of args if (typeof options === 'function') { @@ -413,7 +416,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { span, ns, server, - cursorState.cmd + cursorState.cmd, + 'getMore' ); const patchedCallback = instrumentation._patchEnd(span, resultHandler); // handle when options is the callback to send the correct number of args @@ -472,7 +476,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { span: Span, connectionCtx: any, ns: any, - command?: any + command?: any, + operation?: string ) { let host, port: undefined | string; if (connectionCtx) { @@ -501,7 +506,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { ns.collection, host, port, - commandObj + commandObj, + operation ); } @@ -516,7 +522,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { span: Span, ns: string, topology: MongoInternalTopology, - command?: MongoInternalCommand + command?: MongoInternalCommand, + operation?: string | undefined ) { // add network attributes to determine the remote server let host: undefined | string; @@ -548,7 +555,8 @@ export class MongoDBInstrumentation extends InstrumentationBase { dbCollection, host, port, - commandObj + commandObj, + operation ); } @@ -558,13 +566,15 @@ export class MongoDBInstrumentation extends InstrumentationBase { dbCollection?: string, host?: undefined | string, port?: undefined | string, - commandObj?: any + commandObj?: any, + operation?: string | undefined ) { // add database related attributes span.setAttributes({ [SemanticAttributes.DB_SYSTEM]: DbSystemValues.MONGODB, [SemanticAttributes.DB_NAME]: dbName, [SemanticAttributes.DB_MONGODB_COLLECTION]: dbCollection, + [SemanticAttributes.DB_OPERATION]: operation, }); if (host && port) { diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts index 3a663957f6..5a0b39e773 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts @@ -112,7 +112,12 @@ describe('MongoDBInstrumentation', () => { .insertMany(insertData) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.insert', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.insert', + SpanKind.CLIENT, + 'insert' + ); done(); }) .catch(err => { @@ -128,7 +133,12 @@ describe('MongoDBInstrumentation', () => { .updateOne({ a: 2 }, { $set: { b: 1 } }) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.update', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.update', + SpanKind.CLIENT, + 'update' + ); done(); }) .catch(err => { @@ -144,7 +154,12 @@ describe('MongoDBInstrumentation', () => { .deleteOne({ a: 3 }) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.remove', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.remove', + SpanKind.CLIENT, + 'remove' + ); done(); }) .catch(err => { @@ -164,7 +179,12 @@ describe('MongoDBInstrumentation', () => { .toArray() .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.find', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.find', + SpanKind.CLIENT, + 'find' + ); done(); }) .catch(err => { @@ -190,7 +210,8 @@ describe('MongoDBInstrumentation', () => { span => !span.name.includes('mongodb.getMore') ), 'mongodb.find', - SpanKind.CLIENT + SpanKind.CLIENT, + 'find' ); // assert that we correctly got the first as a find assertSpans( @@ -198,7 +219,8 @@ describe('MongoDBInstrumentation', () => { span => !span.name.includes('mongodb.find') ), 'mongodb.getMore', - SpanKind.CLIENT + SpanKind.CLIENT, + 'getMore' ); done(); }) @@ -222,7 +244,8 @@ describe('MongoDBInstrumentation', () => { assertSpans( getTestSpans(), 'mongodb.createIndexes', - SpanKind.CLIENT + SpanKind.CLIENT, + 'createIndexes' ); done(); }) @@ -253,7 +276,14 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const operationName = 'mongodb.insert'; - assertSpans(spans, operationName, SpanKind.CLIENT, false, false); + assertSpans( + spans, + operationName, + SpanKind.CLIENT, + 'insert', + false, + false + ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string @@ -291,7 +321,14 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const operationName = 'mongodb.insert'; - assertSpans(spans, operationName, SpanKind.CLIENT, false, true); + assertSpans( + spans, + operationName, + SpanKind.CLIENT, + 'insert', + false, + true + ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string @@ -324,7 +361,7 @@ describe('MongoDBInstrumentation', () => { .then(() => { span.end(); const spans = getTestSpans(); - assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT, 'insert'); done(); }) .catch(err => { @@ -421,7 +458,7 @@ describe('MongoDBInstrumentation', () => { .then(() => { span.end(); const spans = getTestSpans(); - assertSpans(spans, 'mongodb.find', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.find', SpanKind.CLIENT, 'find'); done(); }) .catch(err => { @@ -443,7 +480,7 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const mainSpan = spans[spans.length - 1]; - assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT, 'insert'); resetMemoryExporter(); collection @@ -453,7 +490,7 @@ describe('MongoDBInstrumentation', () => { const spans2 = getTestSpans(); spans2.push(mainSpan); - assertSpans(spans2, 'mongodb.find', SpanKind.CLIENT); + assertSpans(spans2, 'mongodb.find', SpanKind.CLIENT, 'find'); assert.strictEqual( mainSpan.spanContext().spanId, spans2[0].parentSpanId diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts index f42be4b03b..3101a947d2 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts @@ -111,7 +111,12 @@ describe('MongoDBInstrumentation', () => { .insertMany(insertData) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.insert', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.insert', + SpanKind.CLIENT, + 'insert' + ); done(); }) .catch(err => { @@ -127,7 +132,12 @@ describe('MongoDBInstrumentation', () => { .updateOne({ a: 2 }, { $set: { b: 1 } }) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.update', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.update', + SpanKind.CLIENT, + 'update' + ); done(); }) .catch(err => { @@ -143,7 +153,12 @@ describe('MongoDBInstrumentation', () => { .deleteOne({ a: 3 }) .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.delete', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.delete', + SpanKind.CLIENT, + 'delete' + ); done(); }) .catch(err => { @@ -163,7 +178,12 @@ describe('MongoDBInstrumentation', () => { .toArray() .then(() => { span.end(); - assertSpans(getTestSpans(), 'mongodb.find', SpanKind.CLIENT); + assertSpans( + getTestSpans(), + 'mongodb.find', + SpanKind.CLIENT, + 'find' + ); done(); }) .catch(err => { @@ -189,7 +209,8 @@ describe('MongoDBInstrumentation', () => { span => !span.name.includes('mongodb.getMore') ), 'mongodb.find', - SpanKind.CLIENT + SpanKind.CLIENT, + 'find' ); // assert that we correctly got the first as a find assertSpans( @@ -197,7 +218,8 @@ describe('MongoDBInstrumentation', () => { span => !span.name.includes('mongodb.find') ), 'mongodb.getMore', - SpanKind.CLIENT + SpanKind.CLIENT, + 'getMore' ); done(); }) @@ -221,7 +243,8 @@ describe('MongoDBInstrumentation', () => { assertSpans( getTestSpans(), 'mongodb.createIndexes', - SpanKind.CLIENT + SpanKind.CLIENT, + 'createIndexes' ); done(); }) @@ -252,7 +275,14 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const operationName = 'mongodb.insert'; - assertSpans(spans, operationName, SpanKind.CLIENT, false, false); + assertSpans( + spans, + operationName, + SpanKind.CLIENT, + 'insert', + false, + false + ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string @@ -290,7 +320,14 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const operationName = 'mongodb.insert'; - assertSpans(spans, operationName, SpanKind.CLIENT, false, true); + assertSpans( + spans, + operationName, + SpanKind.CLIENT, + 'insert', + false, + true + ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string @@ -323,7 +360,7 @@ describe('MongoDBInstrumentation', () => { .then(() => { span.end(); const spans = getTestSpans(); - assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT, 'insert'); done(); }) .catch(err => { @@ -417,7 +454,7 @@ describe('MongoDBInstrumentation', () => { .then(() => { span.end(); const spans = getTestSpans(); - assertSpans(spans, 'mongodb.find', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.find', SpanKind.CLIENT, 'find'); done(); }) .catch(err => { @@ -439,7 +476,7 @@ describe('MongoDBInstrumentation', () => { span.end(); const spans = getTestSpans(); const mainSpan = spans[spans.length - 1]; - assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT); + assertSpans(spans, 'mongodb.insert', SpanKind.CLIENT, 'insert'); resetMemoryExporter(); collection @@ -448,7 +485,7 @@ describe('MongoDBInstrumentation', () => { .then(() => { const spans2 = getTestSpans(); spans2.push(mainSpan); - assertSpans(spans2, 'mongodb.find', SpanKind.CLIENT); + assertSpans(spans2, 'mongodb.find', SpanKind.CLIENT, 'find'); assert.strictEqual( mainSpan.spanContext().spanId, spans2[0].parentSpanId diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts index fde0af56d8..3da0a1833c 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts @@ -65,6 +65,7 @@ export function assertSpans( spans: ReadableSpan[], expectedName: string, expectedKind: SpanKind, + expectedOperation: string, log = false, isEnhancedDatabaseReportingEnabled = false ) { @@ -79,6 +80,10 @@ export function assertSpans( const [mongoSpan] = spans; assert.strictEqual(mongoSpan.name, expectedName); assert.strictEqual(mongoSpan.kind, expectedKind); + assert.strictEqual( + mongoSpan.attributes[SemanticAttributes.DB_OPERATION], + expectedOperation + ); assert.strictEqual( mongoSpan.attributes[SemanticAttributes.DB_SYSTEM], 'mongodb' From 4098e6a3d4257e5da9b8cece430bde7d70319cf3 Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Tue, 13 Dec 2022 09:33:06 +0100 Subject: [PATCH 15/91] feat(restify): add requestHook support (#1312) * feat(restify): add requestHook support The `requestHook` config option allows custom span handling per request layer. * fix(restify): pass config to super class As mentioned in the review, pass the instrumentation config to the parent class. That way the config is also stored when given to the initializer, rather only when using the `setConfig` function. * fix(restify): fix comment referencing restify type Update comment to reference to correct type from the `@types/restify` package. * fix(restify): import missing Span type Add the missing import reported by the linter. * fix(restify): fix issues reported by linter * fix(restify): fix comment referencing restify type Mention the package name exactly. * fix(restify): fix comment referencing restify type Co-authored-by: Amir Blum * fix(restify): add missing import in restify test * feat(restify): add layer argument to requestHook Add the layerType argument to the requestHook function. This is like the following PR but for restify: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1226 Move the LayerType from internal-types to types, because it's now used in a function used by users of the instrumentation package. Co-authored-by: Amir Blum --- .../README.md | 21 +++++ .../src/index.ts | 1 + .../src/instrumentation.ts | 41 ++++++++- .../src/internal-types.ts | 6 +- .../src/types.ts | 45 ++++++++++ .../test/restify.test.ts | 83 ++++++++++++++++++- 6 files changed, 187 insertions(+), 10 deletions(-) create mode 100644 plugins/node/opentelemetry-instrumentation-restify/src/types.ts diff --git a/plugins/node/opentelemetry-instrumentation-restify/README.md b/plugins/node/opentelemetry-instrumentation-restify/README.md index 9ef35ea4da..719a042ab7 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/README.md +++ b/plugins/node/opentelemetry-instrumentation-restify/README.md @@ -41,6 +41,27 @@ registerInstrumentations({ See [examples/restify](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/examples/restify) for a short example. +## Restify Instrumentation Options + +| Options | Type | Example | Description | +| `requestHook` | `RestifyCustomAttributeFunction` | `(span, requestInfo) => {}` | Function for adding custom attributes to restify requests. Receives params: `Span, RestifyRequestInfo`. | + +### Using `requestHook` + +Instrumentation configuration accepts a custom "hook" function which will be called for every instrumented restify request. Custom attributes can be set on the span or run any custom logic per request. + +```javascript +import { RestifyInstrumentation } from "@opentelemetry/instrumentation-restify" +const restifyInstrumentation = new RestifyInstrumentation({ + requestHook: function (span: Span, info: RestifyRequestInfo) { + span.setAttribute( + 'http.method', + info.request.method, + ) + } +}); +``` + ## Useful links - For more information on OpenTelemetry, visit: diff --git a/plugins/node/opentelemetry-instrumentation-restify/src/index.ts b/plugins/node/opentelemetry-instrumentation-restify/src/index.ts index dae24360d1..331bf99930 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/src/index.ts +++ b/plugins/node/opentelemetry-instrumentation-restify/src/index.ts @@ -20,3 +20,4 @@ export * from './instrumentation'; export default RestifyInstrumentation; export * from './enums/AttributeNames'; +export * from './types'; diff --git a/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts index 76fb7b95f9..a856359d96 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts @@ -19,31 +19,44 @@ import type * as restify from 'restify'; import * as api from '@opentelemetry/api'; import type { Server } from 'restify'; -import { LayerType } from './internal-types'; +import { LayerType } from './types'; import * as AttributeNames from './enums/AttributeNames'; import { VERSION } from './version'; import * as constants from './constants'; import { InstrumentationBase, - InstrumentationConfig, InstrumentationNodeModuleDefinition, InstrumentationNodeModuleFile, isWrapped, + safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { isPromise, isAsyncFunction } from './utils'; import { getRPCMetadata, RPCType, setRPCMetadata } from '@opentelemetry/core'; +import type { RestifyInstrumentationConfig } from './types'; const { diag } = api; export class RestifyInstrumentation extends InstrumentationBase { - constructor(config: InstrumentationConfig = {}) { - super(`@opentelemetry/instrumentation-${constants.MODULE_NAME}`, VERSION); + constructor(config: RestifyInstrumentationConfig = {}) { + super( + `@opentelemetry/instrumentation-${constants.MODULE_NAME}`, + VERSION, + Object.assign({}, config) + ); } private _moduleVersion?: string; private _isDisabled = false; + override setConfig(config: RestifyInstrumentationConfig = {}) { + this._config = Object.assign({}, config); + } + + override getConfig(): RestifyInstrumentationConfig { + return this._config as RestifyInstrumentationConfig; + } + init() { const module = new InstrumentationNodeModuleDefinition( constants.MODULE_NAME, @@ -185,6 +198,26 @@ export class RestifyInstrumentation extends InstrumentationBase { }, api.context.active() ); + + const instrumentation = this; + const requestHook = instrumentation.getConfig().requestHook; + if (requestHook) { + safeExecuteInTheMiddle( + () => { + return requestHook!(span, { + request: req, + layerType: metadata.type, + }); + }, + e => { + if (e) { + instrumentation._diag.error('request hook failed', e); + } + }, + true + ); + } + const patchedNext = (err?: any) => { span.end(); next(err); diff --git a/plugins/node/opentelemetry-instrumentation-restify/src/internal-types.ts b/plugins/node/opentelemetry-instrumentation-restify/src/internal-types.ts index d6280a6bda..deb0ea3e98 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/src/internal-types.ts +++ b/plugins/node/opentelemetry-instrumentation-restify/src/internal-types.ts @@ -15,11 +15,7 @@ */ import { Span } from '@opentelemetry/api'; import type * as restify from 'restify'; - -export enum LayerType { - MIDDLEWARE = 'middleware', - REQUEST_HANDLER = 'request_handler', -} +import { LayerType } from './types'; declare interface RequestWithRoute extends restify.Request { route: { path: string }; diff --git a/plugins/node/opentelemetry-instrumentation-restify/src/types.ts b/plugins/node/opentelemetry-instrumentation-restify/src/types.ts new file mode 100644 index 0000000000..238f247a81 --- /dev/null +++ b/plugins/node/opentelemetry-instrumentation-restify/src/types.ts @@ -0,0 +1,45 @@ +/* + * 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 { Span } from '@opentelemetry/api'; +import { InstrumentationConfig } from '@opentelemetry/instrumentation'; + +export enum LayerType { + MIDDLEWARE = 'middleware', + REQUEST_HANDLER = 'request_handler', +} + +export interface RestifyRequestInfo { + request: any; // Request type from @types/restify package + layerType: LayerType; +} + +/** + * Function that can be used to add custom attributes to the current span + * @param span - The restify handler span. + * @param info - The restify request info object. + */ +export interface RestifyCustomAttributeFunction { + (span: Span, info: RestifyRequestInfo): void; +} + +/** + * Options available for the restify Instrumentation + */ +export interface RestifyInstrumentationConfig extends InstrumentationConfig { + /** Function for adding custom attributes to each handler span */ + requestHook?: RestifyCustomAttributeFunction; +} diff --git a/plugins/node/opentelemetry-instrumentation-restify/test/restify.test.ts b/plugins/node/opentelemetry-instrumentation-restify/test/restify.test.ts index 33ce317188..0e381bf969 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/test/restify.test.ts +++ b/plugins/node/opentelemetry-instrumentation-restify/test/restify.test.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { context, trace } from '@opentelemetry/api'; +import { context, trace, Span } from '@opentelemetry/api'; +import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; import { RPCType, setRPCMetadata } from '@opentelemetry/core'; import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks'; @@ -25,6 +26,7 @@ import { import RestifyInstrumentation from '../src'; import * as types from '../src/internal-types'; +import { RestifyRequestInfo } from '../src/types'; const plugin = new RestifyInstrumentation(); import * as semver from 'semver'; @@ -487,6 +489,85 @@ describe('Restify Instrumentation', () => { assert.strictEqual(memoryExporter.getFinishedSpans().length, 3); assert.strictEqual(res, '{"route":"bar"}'); }); + + describe('using requestHook in config', () => { + it('calls requestHook provided function when set in config', async () => { + const requestHook = (span: Span, info: RestifyRequestInfo) => { + span.setAttribute( + SemanticAttributes.HTTP_METHOD, + info.request.method + ); + span.setAttribute('restify.layer', info.layerType); + }; + + plugin.setConfig({ + ...plugin.getConfig(), + requestHook, + }); + + const rootSpan = tracer.startSpan('clientSpan'); + + await context.with( + trace.setSpan(context.active(), rootSpan), + async () => { + await httpRequest.get(`http://localhost:${port}/route/foo`); + rootSpan.end(); + assert.strictEqual(memoryExporter.getFinishedSpans().length, 4); + + { + // span from get + const span = memoryExporter.getFinishedSpans()[2]; + assert.notStrictEqual(span, undefined); + assert.strictEqual( + span.attributes[SemanticAttributes.HTTP_METHOD], + 'GET' + ); + assert.strictEqual( + span.attributes['restify.layer'], + 'request_handler' + ); + } + } + ); + }); + + it('does not propagate an error from a requestHook that throws exception', async () => { + const requestHook = (span: Span, info: RestifyRequestInfo) => { + span.setAttribute( + SemanticAttributes.HTTP_METHOD, + info.request.method + ); + + throw Error('error thrown in requestHook'); + }; + + plugin.setConfig({ + ...plugin.getConfig(), + requestHook, + }); + + const rootSpan = tracer.startSpan('clientSpan'); + + await context.with( + trace.setSpan(context.active(), rootSpan), + async () => { + await httpRequest.get(`http://localhost:${port}/route/foo`); + rootSpan.end(); + assert.strictEqual(memoryExporter.getFinishedSpans().length, 4); + + { + // span from get + const span = memoryExporter.getFinishedSpans()[2]; + assert.notStrictEqual(span, undefined); + assert.strictEqual( + span.attributes[SemanticAttributes.HTTP_METHOD], + 'GET' + ); + } + } + ); + }); + }); }); describe('Disabling restify instrumentation', () => { From a11630333734a284f961cf31276dc5da3247a3af Mon Sep 17 00:00:00 2001 From: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com> Date: Sun, 18 Dec 2022 13:22:57 +0200 Subject: [PATCH 16/91] fix(component owner): add haddasbronfman as component owner of opentelemetry-redis-common (#1327) Co-authored-by: Amir Blum --- .github/component_owners.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/component_owners.yml b/.github/component_owners.yml index acc7575d3a..3974e546ee 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -14,6 +14,8 @@ components: - legendecas packages/opentelemetry-id-generator-aws-xray: - willarmiros + packages/opentelemetry-redis-common: + - haddasbronfman plugins/node/instrumentation-amqplib: - blumamir plugins/node/instrumentation-dataloader: From 378f130befb2bd8be42d367b9db5ae9329d57b5e Mon Sep 17 00:00:00 2001 From: Osher Vaknin <81672378+osherv@users.noreply.github.com> Date: Wed, 21 Dec 2022 00:40:20 +0200 Subject: [PATCH 17/91] fix(redis-4): add support to new version of redis (#1324) * fix(redis-4): removed support for redis >4.5.1 (client >1.4.2) who breaks the CI) * fix(redis-4): added new wrap to MULTI function * fix(redis-4): added new wrap to MULTI function * fix(redis-4): fixed Amir's CR --- .../src/instrumentation.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts index b4b229f66f..4bf503e6c4 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts @@ -175,6 +175,15 @@ export class RedisInstrumentation extends InstrumentationBase { this._getPatchRedisClientMulti() ); + if (isWrapped(redisClientPrototype?.MULTI)) { + this._unwrap(redisClientPrototype, 'MULTI'); + } + this._wrap( + redisClientPrototype, + 'MULTI', + this._getPatchRedisClientMulti() + ); + if (isWrapped(redisClientPrototype?.sendCommand)) { this._unwrap(redisClientPrototype, 'sendCommand'); } @@ -198,6 +207,9 @@ export class RedisInstrumentation extends InstrumentationBase { if (isWrapped(redisClientPrototype?.multi)) { this._unwrap(redisClientPrototype, 'multi'); } + if (isWrapped(redisClientPrototype?.MULTI)) { + this._unwrap(redisClientPrototype, 'MULTI'); + } if (isWrapped(redisClientPrototype?.sendCommand)) { this._unwrap(redisClientPrototype, 'sendCommand'); } From 8472e8273d14993a13f921b6f8173b20fb37a383 Mon Sep 17 00:00:00 2001 From: Daniel Dyla Date: Fri, 30 Dec 2022 09:19:31 -0500 Subject: [PATCH 18/91] chore: release main (#1301) --- .release-please-manifest.json | 2 +- .../auto-instrumentations-node/CHANGELOG.md | 20 +++++++++++++++++++ .../auto-instrumentations-node/package.json | 16 +++++++-------- .../opentelemetry-redis-common/CHANGELOG.md | 13 ++++++++++++ .../opentelemetry-redis-common/package.json | 2 +- .../instrumentation-socket.io/CHANGELOG.md | 9 +++++++++ .../instrumentation-socket.io/package.json | 2 +- .../CHANGELOG.md | 14 +++++++++++++ .../package.json | 4 ++-- .../CHANGELOG.md | 7 +++++++ .../package.json | 2 +- .../CHANGELOG.md | 13 ++++++++++++ .../package.json | 2 +- .../CHANGELOG.md | 15 ++++++++++++++ .../package.json | 4 ++-- .../CHANGELOG.md | 14 +++++++++++++ .../package.json | 4 ++-- .../CHANGELOG.md | 7 +++++++ .../package.json | 2 +- 19 files changed, 132 insertions(+), 20 deletions(-) create mode 100644 packages/opentelemetry-redis-common/CHANGELOG.md create mode 100644 plugins/node/instrumentation-socket.io/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9910dc9599..3ef0fb04ab 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.35.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-redis-common":"0.33.0","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-socket.io": "0.32.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.0","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.33.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.33.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.0","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.0","plugins/node/opentelemetry-instrumentation-restify":"0.31.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.36.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-redis-common":"0.34.0","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-socket.io":"0.33.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.1","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.34.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.34.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.1","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.1","plugins/node/opentelemetry-instrumentation-restify":"0.32.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} diff --git a/metapackages/auto-instrumentations-node/CHANGELOG.md b/metapackages/auto-instrumentations-node/CHANGELOG.md index 06f7a2d796..017d068361 100644 --- a/metapackages/auto-instrumentations-node/CHANGELOG.md +++ b/metapackages/auto-instrumentations-node/CHANGELOG.md @@ -52,6 +52,26 @@ * dependencies * @opentelemetry/instrumentation-express bumped from ^0.31.1 to ^0.31.2 +## [0.36.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.35.0...auto-instrumentations-node-v0.36.0) (2022-12-20) + + +### Features + +* add socket.io instrumentation ([#1284](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1284)) ([f865143](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/f865143d9042c41ebed6adbe906097ad7622f2c7)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/instrumentation-ioredis bumped from ^0.33.0 to ^0.33.1 + * @opentelemetry/instrumentation-mongodb bumped from ^0.33.0 to ^0.34.0 + * @opentelemetry/instrumentation-pg bumped from ^0.33.0 to ^0.34.0 + * @opentelemetry/instrumentation-redis bumped from ^0.34.0 to ^0.34.1 + * @opentelemetry/instrumentation-redis-4 bumped from ^0.34.0 to ^0.34.1 + * @opentelemetry/instrumentation-restify bumped from ^0.31.0 to ^0.32.0 + * @opentelemetry/instrumentation-socket.io bumped from ^0.32.0 to ^0.33.0 + ## [0.35.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/auto-instrumentations-node-v0.34.0...auto-instrumentations-node-v0.35.0) (2022-11-16) diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index 5ad4e86a17..314f4e5a04 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/auto-instrumentations-node", - "version": "0.35.0", + "version": "0.36.0", "description": "Metapackage which bundles opentelemetry node core and contrib instrumentations", "author": "OpenTelemetry Authors", "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node#readme", @@ -63,24 +63,24 @@ "@opentelemetry/instrumentation-grpc": "^0.34.0", "@opentelemetry/instrumentation-hapi": "^0.31.0", "@opentelemetry/instrumentation-http": "^0.34.0", - "@opentelemetry/instrumentation-ioredis": "^0.33.0", + "@opentelemetry/instrumentation-ioredis": "^0.33.1", "@opentelemetry/instrumentation-knex": "^0.31.0", "@opentelemetry/instrumentation-koa": "^0.34.0", "@opentelemetry/instrumentation-lru-memoizer": "^0.32.0", "@opentelemetry/instrumentation-memcached": "^0.31.0", - "@opentelemetry/instrumentation-mongodb": "^0.33.0", + "@opentelemetry/instrumentation-mongodb": "^0.34.0", "@opentelemetry/instrumentation-mongoose": "^0.32.0", "@opentelemetry/instrumentation-mysql": "^0.32.0", "@opentelemetry/instrumentation-mysql2": "^0.33.0", "@opentelemetry/instrumentation-nestjs-core": "^0.32.0", "@opentelemetry/instrumentation-net": "^0.31.0", - "@opentelemetry/instrumentation-pg": "^0.33.0", + "@opentelemetry/instrumentation-pg": "^0.34.0", "@opentelemetry/instrumentation-pino": "^0.33.0", - "@opentelemetry/instrumentation-redis": "^0.34.0", - "@opentelemetry/instrumentation-redis-4": "^0.34.0", - "@opentelemetry/instrumentation-restify": "^0.31.0", + "@opentelemetry/instrumentation-redis": "^0.34.1", + "@opentelemetry/instrumentation-redis-4": "^0.34.1", + "@opentelemetry/instrumentation-restify": "^0.32.0", "@opentelemetry/instrumentation-router": "^0.32.0", - "@opentelemetry/instrumentation-socket.io": "^0.32.0", + "@opentelemetry/instrumentation-socket.io": "^0.33.0", "@opentelemetry/instrumentation-tedious": "^0.5.0", "@opentelemetry/instrumentation-winston": "^0.31.0" } diff --git a/packages/opentelemetry-redis-common/CHANGELOG.md b/packages/opentelemetry-redis-common/CHANGELOG.md new file mode 100644 index 0000000000..a098eecb92 --- /dev/null +++ b/packages/opentelemetry-redis-common/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/redis-common-v0.33.0...redis-common-v0.34.0) (2022-12-20) + + +### Features + +* upstream mocha instrumentation testing plugin from ext-js [#621](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/621) ([#669](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/669)) ([a5170c4](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/a5170c494706a2bec3ba51e59966d0ca8a41d00e)) + + +### Bug Fixes + +* **redis:** serialize non sensitive arguments into db.statement attribute ([#1299](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1299)) ([092a250](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/092a2509bcf884e1b997e0eaec3a6ca02cfd2058)) diff --git a/packages/opentelemetry-redis-common/package.json b/packages/opentelemetry-redis-common/package.json index 037c492099..d2add794fe 100644 --- a/packages/opentelemetry-redis-common/package.json +++ b/packages/opentelemetry-redis-common/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/redis-common", - "version": "0.33.0", + "version": "0.34.0", "description": "Redis utilities for redis instrumentations", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/instrumentation-socket.io/CHANGELOG.md b/plugins/node/instrumentation-socket.io/CHANGELOG.md new file mode 100644 index 0000000000..b0940745a7 --- /dev/null +++ b/plugins/node/instrumentation-socket.io/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-socket.io-v0.32.0...instrumentation-socket.io-v0.33.0) (2022-12-20) + + +### Features + +* add socket.io instrumentation ([#1284](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1284)) ([f865143](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/f865143d9042c41ebed6adbe906097ad7622f2c7)) +* upstream mocha instrumentation testing plugin from ext-js [#621](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/621) ([#669](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/669)) ([a5170c4](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/a5170c494706a2bec3ba51e59966d0ca8a41d00e)) diff --git a/plugins/node/instrumentation-socket.io/package.json b/plugins/node/instrumentation-socket.io/package.json index f6b1191099..8ffc90a3bf 100644 --- a/plugins/node/instrumentation-socket.io/package.json +++ b/plugins/node/instrumentation-socket.io/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-socket.io", - "version": "0.32.0", + "version": "0.33.0", "description": "OpenTelemetry automatic instrumentation package for socket.io", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md index 804ea5d3cc..d29dea2629 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-ioredis/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.33.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-ioredis-v0.33.0...instrumentation-ioredis-v0.33.1) (2022-12-20) + + +### Bug Fixes + +* **redis:** serialize non sensitive arguments into db.statement attribute ([#1299](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1299)) ([092a250](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/092a2509bcf884e1b997e0eaec3a6ca02cfd2058)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/redis-common bumped from ^0.33.0 to ^0.34.0 + ## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-ioredis-v0.32.2...instrumentation-ioredis-v0.33.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/package.json b/plugins/node/opentelemetry-instrumentation-ioredis/package.json index 32522684f7..d05e59cbaf 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/package.json +++ b/plugins/node/opentelemetry-instrumentation-ioredis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-ioredis", - "version": "0.33.0", + "version": "0.33.1", "description": "OpenTelemetry ioredis automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -71,7 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", - "@opentelemetry/redis-common": "^0.33.0", + "@opentelemetry/redis-common": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/ioredis": "4.26.6" }, diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md index eb2b6d7c88..0d34a21eb6 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-mongodb/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongodb-v0.33.0...instrumentation-mongodb-v0.34.0) (2022-12-20) + + +### Features + +* **mongodb:** add db.operation span attribute ([#1321](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1321)) ([97305e1](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/97305e1880ecbfb3b87d6c38f0c6521570583510)) + ## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongodb-v0.32.2...instrumentation-mongodb-v0.33.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/package.json index 14a2b29b54..b0232a3287 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-mongodb", - "version": "0.33.0", + "version": "0.34.0", "description": "OpenTelemetry mongodb automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md index f317244e5d..6d765bee3e 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-pg/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pg-v0.33.0...instrumentation-pg-v0.34.0) (2022-12-20) + + +### Features + +* add sqlcommenter comment with trace context to queries in pg instrumentation ([#1286](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1286)) ([a0003e7](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/a0003e76fc46afbbee2558a7d21906be7c9cb1d1)) +* **pg:** support requestHook hook ([#1307](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1307)) ([f0a9368](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/f0a93685cfb43543b7ca577dd370d56576b49e3f)) + + +### Bug Fixes + +* pg span names ([#1306](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1306)) ([8a375f5](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/8a375f59f3043a7d3749b1e8af5603b9ed30f08f)) + ## [0.33.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-pg-v0.32.0...instrumentation-pg-v0.33.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index d3d4e2de1b..918375f69a 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-pg", - "version": "0.33.0", + "version": "0.34.0", "description": "OpenTelemetry postgres automatic instrumentation package.", "main": "build/src/index.js", "types": "build/src/index.d.ts", diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md index f9386e6b6f..49f7ca6e89 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-redis-4/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [0.34.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-4-v0.34.0...instrumentation-redis-4-v0.34.1) (2022-12-20) + + +### Bug Fixes + +* **redis-4:** add support to new version of redis ([#1324](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1324)) ([378f130](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/378f130befb2bd8be42d367b9db5ae9329d57b5e)) +* **redis:** serialize non sensitive arguments into db.statement attribute ([#1299](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1299)) ([092a250](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/092a2509bcf884e1b997e0eaec3a6ca02cfd2058)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/redis-common bumped from ^0.33.0 to ^0.34.0 + ## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-4-v0.33.1...instrumentation-redis-4-v0.34.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/package.json b/plugins/node/opentelemetry-instrumentation-redis-4/package.json index d4284e0568..f2eb5ec0a7 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis-4/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-redis-4", - "version": "0.34.0", + "version": "0.34.1", "description": "Automatic OpenTelemetry instrumentation for redis package version 4", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -71,7 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", - "@opentelemetry/redis-common": "^0.33.0", + "@opentelemetry/redis-common": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis-4#readme" diff --git a/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md index 481940fac9..6a4304734b 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-redis/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.34.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.34.0...instrumentation-redis-v0.34.1) (2022-12-20) + + +### Bug Fixes + +* **redis:** serialize non sensitive arguments into db.statement attribute ([#1299](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1299)) ([092a250](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/092a2509bcf884e1b997e0eaec3a6ca02cfd2058)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * @opentelemetry/redis-common bumped from ^0.33.0 to ^0.34.0 + ## [0.34.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-redis-v0.33.1...instrumentation-redis-v0.34.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-redis/package.json b/plugins/node/opentelemetry-instrumentation-redis/package.json index f0a9046162..339bce4872 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-redis", - "version": "0.34.0", + "version": "0.34.1", "description": "Automatic OpenTelemetry instrumentation for redis package version 2 and 3", "main": "build/src/index.js", "types": "build/src/index.d.ts", @@ -71,7 +71,7 @@ }, "dependencies": { "@opentelemetry/instrumentation": "^0.34.0", - "@opentelemetry/redis-common": "^0.33.0", + "@opentelemetry/redis-common": "^0.34.0", "@opentelemetry/semantic-conventions": "^1.0.0", "@types/redis": "2.8.31" }, diff --git a/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md b/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md index 0f61989954..5bc2799d58 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md +++ b/plugins/node/opentelemetry-instrumentation-restify/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.32.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-restify-v0.31.0...instrumentation-restify-v0.32.0) (2022-12-20) + + +### Features + +* **restify:** add requestHook support ([#1312](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1312)) ([4098e6a](https://github.com/open-telemetry/opentelemetry-js-contrib/commit/4098e6a3d4257e5da9b8cece430bde7d70319cf3)) + ## [0.31.0](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-restify-v0.30.1...instrumentation-restify-v0.31.0) (2022-11-16) diff --git a/plugins/node/opentelemetry-instrumentation-restify/package.json b/plugins/node/opentelemetry-instrumentation-restify/package.json index 6dc057e31d..4b5f05904b 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/package.json +++ b/plugins/node/opentelemetry-instrumentation-restify/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-restify", - "version": "0.31.0", + "version": "0.32.0", "description": "OpenTelemetry restify automatic instrumentation package", "main": "build/src/index.js", "types": "build/src/index.d.ts", From 28ad01e040f44a7b9ff1f76c4ba486074e8faf9c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 1 Jan 2023 11:54:55 +0100 Subject: [PATCH 19/91] chore(deps): update dependency express to v4.17.3 [security] (#1330) Co-authored-by: Amir Blum --- plugins/node/opentelemetry-instrumentation-express/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-express/package.json b/plugins/node/opentelemetry-instrumentation-express/package.json index 84a26df0d2..674811f90a 100644 --- a/plugins/node/opentelemetry-instrumentation-express/package.json +++ b/plugins/node/opentelemetry-instrumentation-express/package.json @@ -55,7 +55,7 @@ "@types/mocha": "7.0.2", "@types/node": "18.11.7", "@types/sinon": "10.0.9", - "express": "4.17.1", + "express": "4.17.3", "gts": "3.1.0", "mocha": "7.2.0", "nyc": "15.1.0", From cd9984aecfba46723ad51a3bf5d023a3d8c253eb Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Mon, 2 Jan 2023 04:53:43 +0200 Subject: [PATCH 20/91] chore(aws-sdk): bump aws-sdk version to align with previous releases (#1302) --- .release-please-manifest.json | 2 +- metapackages/auto-instrumentations-node/package.json | 2 +- plugins/node/opentelemetry-instrumentation-aws-sdk/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3ef0fb04ab..5ff9cfbba4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.36.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-redis-common":"0.34.0","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-socket.io":"0.33.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.10.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.1","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.34.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.34.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.1","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.1","plugins/node/opentelemetry-instrumentation-restify":"0.32.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} +{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.27.3","detectors/node/opentelemetry-resource-detector-aws":"1.2.1","detectors/node/opentelemetry-resource-detector-container":"0.2.1","detectors/node/opentelemetry-resource-detector-gcp":"0.27.4","detectors/node/opentelemetry-resource-detector-github":"0.27.0","detectors/node/opentelemetry-resource-detector-instana":"0.4.0","metapackages/auto-instrumentations-node":"0.36.0","metapackages/auto-instrumentations-web":"0.31.0","packages/opentelemetry-host-metrics":"0.31.0","packages/opentelemetry-id-generator-aws-xray":"1.1.1","packages/opentelemetry-propagation-utils":"0.29.1","packages/opentelemetry-redis-common":"0.34.0","packages/opentelemetry-test-utils":"0.33.0","plugins/node/instrumentation-amqplib":"0.32.0","plugins/node/instrumentation-dataloader":"0.3.0","plugins/node/instrumentation-fs":"0.6.0","plugins/node/instrumentation-lru-memoizer":"0.32.0","plugins/node/instrumentation-mongoose":"0.32.0","plugins/node/instrumentation-socket.io":"0.33.0","plugins/node/instrumentation-tedious":"0.5.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.34.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.33.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.31.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.32.0","plugins/node/opentelemetry-instrumentation-connect":"0.31.0","plugins/node/opentelemetry-instrumentation-dns":"0.31.0","plugins/node/opentelemetry-instrumentation-express":"0.32.0","plugins/node/opentelemetry-instrumentation-fastify":"0.31.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.31.0","plugins/node/opentelemetry-instrumentation-graphql":"0.33.0","plugins/node/opentelemetry-instrumentation-hapi":"0.31.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.33.1","plugins/node/opentelemetry-instrumentation-knex":"0.31.0","plugins/node/opentelemetry-instrumentation-koa":"0.34.0","plugins/node/opentelemetry-instrumentation-memcached":"0.31.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.34.0","plugins/node/opentelemetry-instrumentation-mysql":"0.32.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.33.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.32.0","plugins/node/opentelemetry-instrumentation-net":"0.31.0","plugins/node/opentelemetry-instrumentation-pg":"0.34.0","plugins/node/opentelemetry-instrumentation-pino":"0.33.0","plugins/node/opentelemetry-instrumentation-redis":"0.34.1","plugins/node/opentelemetry-instrumentation-redis-4":"0.34.1","plugins/node/opentelemetry-instrumentation-restify":"0.32.0","plugins/node/opentelemetry-instrumentation-router":"0.32.0","plugins/node/opentelemetry-instrumentation-winston":"0.31.0","plugins/web/opentelemetry-instrumentation-document-load":"0.31.0","plugins/web/opentelemetry-instrumentation-long-task":"0.32.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.32.0","plugins/web/opentelemetry-plugin-react-load":"0.28.1","propagators/opentelemetry-propagator-aws-xray":"1.1.1","propagators/opentelemetry-propagator-grpc-census-binary":"0.26.0","propagators/opentelemetry-propagator-instana":"0.2.1","propagators/opentelemetry-propagator-ot-trace":"0.26.2"} diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index 314f4e5a04..78796154a3 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -49,7 +49,7 @@ "@opentelemetry/instrumentation": "^0.34.0", "@opentelemetry/instrumentation-amqplib": "^0.32.0", "@opentelemetry/instrumentation-aws-lambda": "^0.34.0", - "@opentelemetry/instrumentation-aws-sdk": "^0.10.0", + "@opentelemetry/instrumentation-aws-sdk": "^0.33.0", "@opentelemetry/instrumentation-bunyan": "^0.31.0", "@opentelemetry/instrumentation-cassandra-driver": "^0.32.0", "@opentelemetry/instrumentation-connect": "^0.31.0", diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json index 4535cbdc8f..fd44fdd373 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/instrumentation-aws-sdk", - "version": "0.10.0", + "version": "0.33.0", "description": "OpenTelemetry automatic instrumentation for the `aws-sdk` package", "keywords": [ "aws", From 72e961cf8a0ebc3545584f9ad473da2e4195dd47 Mon Sep 17 00:00:00 2001 From: Vasi Vasireddy <41936996+vasireddy99@users.noreply.github.com> Date: Mon, 2 Jan 2023 08:39:09 -0800 Subject: [PATCH 21/91] chore(GHA): Update the usage of set-output command in GH actions (#1296) --- .github/workflows/test-all-versions.pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all-versions.pr.yml b/.github/workflows/test-all-versions.pr.yml index d0f9528d31..95271fa495 100644 --- a/.github/workflows/test-all-versions.pr.yml +++ b/.github/workflows/test-all-versions.pr.yml @@ -27,7 +27,7 @@ jobs: id: lerna-args run: | OUTPUT=`node scripts/parse-lerna-scopes.mjs "$PR_LABELS"` - echo "::set-output name=args::$OUTPUT" + echo "args=$OUTPUT" >> $GITHUB_OUTPUT tav: uses: ./.github/workflows/test-all-versions.yml From 8b8bfebdd6b4f43a8df540979874a6c01c999957 Mon Sep 17 00:00:00 2001 From: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:03:10 +0200 Subject: [PATCH 22/91] feat(mysql): Metrics for mysql (#1220) --- .../examples/README.md | 12 +- .../collector/otel-collector-config.yaml | 44 + .../examples/docker/docker-compose.yaml | 68 + .../examples/docker/grafana/grafana.ini | 1170 +++++++++++++ .../dashboards/opentelemetry-collector.json | 1554 +++++++++++++++++ .../provisioning/datasources/default.yaml | 7 + .../examples/docker/mysql/init.sql | 2 + .../docker/prometheus/prometheus.yaml | 6 + .../examples/package.json | 1 + .../examples/src/client.ts | 32 + .../examples/src/server.ts | 92 + .../examples/src/tracer.ts | 28 +- .../package.json | 5 +- .../src/instrumentation.ts | 114 +- .../src/utils.ts | 14 + .../test/index.metrics.test.ts | 360 ++++ .../test/index.test.ts | 2 +- .../test/utils.test.ts | 53 + 18 files changed, 3553 insertions(+), 11 deletions(-) create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/collector/otel-collector-config.yaml create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/grafana.ini create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/provisioning/dashboards/opentelemetry-collector.json create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/provisioning/datasources/default.yaml create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/mysql/init.sql create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/examples/docker/prometheus/prometheus.yaml create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/test/index.metrics.test.ts create mode 100644 plugins/node/opentelemetry-instrumentation-mysql/test/utils.test.ts diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/README.md b/plugins/node/opentelemetry-instrumentation-mysql/examples/README.md index 7b3180e372..f9bad1d088 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/examples/README.md +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/README.md @@ -1,6 +1,6 @@ # Overview -OpenTelemetry MySQL Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems. +OpenTelemetry MySQL Instrumentation allows the user to automatically collect trace data and metrics and export them to the backend of choice (we can use Zipkin, Jaeger or Grafana for this example), to give observability to distributed systems. This is a modification of the HTTP example that executes multiple parallel requests that interact with a MySQL server backend using the `mysql` npm module. The example displays traces using multiple connection methods. @@ -8,6 +8,10 @@ This is a modification of the HTTP example that executes multiple parallel reque - Pool Connection Query - Cluster Pool Connection Query +## supported metrics + +- Currently only `db.client.connections.usage` is supported, which denoted the number of idle/used connections. + ## Installation ```sh @@ -19,6 +23,12 @@ Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html) or Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one) +In case you want to see also metrics: + +1. Go to `docker` folder +2. Run `docker compose up`. This will set up Zipkin, Jaeger, otel collector, Prometheus and Grafana. +3. To see your metrics, go to `http://localhost:3000/`. + ## Run the Application ### Zipkin diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/collector/otel-collector-config.yaml b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/collector/otel-collector-config.yaml new file mode 100644 index 0000000000..bf4e67b135 --- /dev/null +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/collector/otel-collector-config.yaml @@ -0,0 +1,44 @@ +receivers: + otlp: + protocols: + grpc: + +exporters: + prometheus: + endpoint: "0.0.0.0:8889" + const_labels: + label1: value1 + + logging: + loglevel: debug + + zipkin: + endpoint: "http://zipkin-all-in-one:9411/api/v2/spans" + format: proto + + jaeger: + endpoint: jaeger-all-in-one:14250 + tls: + insecure: true + +processors: + batch: + +extensions: + health_check: + pprof: + endpoint: :1888 + zpages: + endpoint: :55679 + +service: + extensions: [pprof, zpages, health_check] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [logging] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [logging, prometheus] diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml new file mode 100644 index 0000000000..88cc5e4c0e --- /dev/null +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml @@ -0,0 +1,68 @@ +version: "2" +services: + +# mysql + mysql: + image: mysql:5.7 + command: --init-file /etc/mysql/init.sql + volumes: + - ./mysql/init.sql:/etc/mysql/init.sql + environment: + - MYSQL_ROOT_PASSWORD=secret + ports: + - "3306:3306" + +# Jaeger + + jaeger-all-in-one: + image: jaegertracing/all-in-one:latest + ports: + - "16686:16686" + - "14268" + - "14250" + +# Zipkin + + zipkin-all-in-one: + image: openzipkin/zipkin:latest + ports: + - "9411:9411" + +# Collector + + otel-collector: + image: otel/opentelemetry-collector-contrib:0.61.0 + command: ["--config=/etc/otel-collector-config.yaml", ""] + volumes: + - ./collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "1888:1888" # pprof extension + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter metrics + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "55679:55679" # zpages extension + depends_on: + - jaeger-all-in-one + - zipkin-all-in-one + +# Prometheus + + prometheus: + image: quay.io/prometheus/prometheus:v2.34.0 + command: --config.file=/etc/prometheus/prometheus.yml --no-scrape.adjust-timestamps + volumes: + - ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml + ports: + - "9090:9090" + +# Grafana + + grafana: + image: grafana/grafana:9.0.1 + container_name: grafana + volumes: + - ./grafana/grafana.ini:/etc/grafana/grafana.ini + - ./grafana/provisioning/:/etc/grafana/provisioning/ + ports: + - "3000:3000" diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/grafana.ini b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/grafana.ini new file mode 100644 index 0000000000..519810a52b --- /dev/null +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/grafana/grafana.ini @@ -0,0 +1,1170 @@ +##################### Grafana Configuration Example ##################### +# +# Everything has defaults so you only need to uncomment things you want to +# change + +# possible values : production, development +;app_mode = production + +# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty +;instance_name = ${HOSTNAME} + +# force migration will run migrations that might cause dataloss +;force_migration = false + +#################################### Paths #################################### +[paths] +# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) +;data = /var/lib/grafana + +# Temporary files in `data` directory older than given duration will be removed +;temp_data_lifetime = 24h + +# Directory where grafana can store logs +;logs = /var/log/grafana + +# Directory where grafana will automatically scan and look for plugins +;plugins = /var/lib/grafana/plugins + +# folder that contains provisioning config files that grafana will apply on startup and while running. +provisioning = /etc/grafana/provisioning + +#################################### Server #################################### +[server] +# Protocol (http, https, h2, socket) +;protocol = http + +# The ip address to bind to, empty will bind to all interfaces +;http_addr = + +# The http port to use +;http_port = 3000 + +# The public facing domain name used to access grafana from a browser +;domain = localhost + +# Redirect to correct domain if host header does not match domain +# Prevents DNS rebinding attacks +;enforce_domain = false + +# The full public facing url you use in browser, used for redirects and emails +# If you use reverse proxy and sub path specify full url (with sub path) +;root_url = %(protocol)s://%(domain)s:%(http_port)s/ + +# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. +;serve_from_sub_path = false + +# Log web requests +;router_logging = false + +# the path relative working path +;static_root_path = public + +# enable gzip +;enable_gzip = false + +# https certs & key file +;cert_file = +;cert_key = + +# Unix socket path +;socket = + +# CDN Url +;cdn_url = + +# Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections. +# `0` means there is no timeout for reading the request. +;read_timeout = 0 + +#################################### Database #################################### +[database] +# You can configure the database connection by specifying type, host, name, user and password +# as separate properties or as on string using the url properties. + +# Either "mysql", "postgres" or "sqlite3", it's your choice +;type = sqlite3 +;host = 127.0.0.1:3306 +;name = grafana +;user = root +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" +;password = + +# Use either URL or the previous fields to configure the database +# Example: mysql://user:secret@host:port/database +;url = + +# For "postgres" only, either "disable", "require" or "verify-full" +;ssl_mode = disable + +# Database drivers may support different transaction isolation levels. +# Currently, only "mysql" driver supports isolation levels. +# If the value is empty - driver's default isolation level is applied. +# For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE". +;isolation_level = + +;ca_cert_path = +;client_key_path = +;client_cert_path = +;server_cert_name = + +# For "sqlite3" only, path relative to data_path setting +;path = grafana.db + +# Max idle conn setting default is 2 +;max_idle_conn = 2 + +# Max conn setting default is 0 (mean not set) +;max_open_conn = + +# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours) +;conn_max_lifetime = 14400 + +# Set to true to log the sql calls and execution times. +;log_queries = + +# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared) +;cache_mode = private + +# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0. +;locking_attempt_timeout_sec = 0 + +################################### Data sources ######################### +[datasources] +# Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API. +;datasource_limit = 5000 + +#################################### Cache server ############################# +[remote_cache] +# Either "redis", "memcached" or "database" default is "database" +;type = database + +# cache connectionstring options +# database: will use Grafana primary database. +# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'. +# memcache: 127.0.0.1:11211 +;connstr = + +#################################### Data proxy ########################### +[dataproxy] + +# This enables data proxy logging, default is false +;logging = false + +# How long the data proxy waits to read the headers of the response before timing out, default is 30 seconds. +# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set. +;timeout = 30 + +# How long the data proxy waits to establish a TCP connection before timing out, default is 10 seconds. +;dialTimeout = 10 + +# How many seconds the data proxy waits before sending a keepalive probe request. +;keep_alive_seconds = 30 + +# How many seconds the data proxy waits for a successful TLS Handshake before timing out. +;tls_handshake_timeout_seconds = 10 + +# How many seconds the data proxy will wait for a server's first response headers after +# fully writing the request headers if the request has an "Expect: 100-continue" +# header. A value of 0 will result in the body being sent immediately, without +# waiting for the server to approve. +;expect_continue_timeout_seconds = 1 + +# Optionally limits the total number of connections per host, including connections in the dialing, +# active, and idle states. On limit violation, dials will block. +# A value of zero (0) means no limit. +;max_conns_per_host = 0 + +# The maximum number of idle connections that Grafana will keep alive. +;max_idle_connections = 100 + +# How many seconds the data proxy keeps an idle connection open before timing out. +;idle_conn_timeout_seconds = 90 + +# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false. +;send_user_header = false + +# Limit the amount of bytes that will be read/accepted from responses of outgoing HTTP requests. +;response_limit = 0 + +# Limits the number of rows that Grafana will process from SQL data sources. +;row_limit = 1000000 + +#################################### Analytics #################################### +[analytics] +# Server reporting, sends usage counters to stats.grafana.org every 24 hours. +# No ip addresses are being tracked, only simple counters to track +# running instances, dashboard and error counts. It is very helpful to us. +# Change this option to false to disable reporting. +;reporting_enabled = true + +# The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs +;reporting_distributor = grafana-labs + +# Set to false to disable all checks to https://grafana.com +# for new versions of grafana. The check is used +# in some UI views to notify that a grafana update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version. +;check_for_updates = true + +# Set to false to disable all checks to https://grafana.com +# for new versions of plugins. The check is used +# in some UI views to notify that a plugin update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://grafana.com to get the latest versions. +;check_for_plugin_updates = true + +# Google Analytics universal tracking code, only enabled if you specify an id here +;google_analytics_ua_id = + +# Google Tag Manager ID, only enabled if you specify an id here +;google_tag_manager_id = + +# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set +;rudderstack_write_key = + +# Rudderstack data plane url, enabled only if rudderstack_write_key is also set +;rudderstack_data_plane_url = + +# Rudderstack SDK url, optional, only valid if rudderstack_write_key and rudderstack_data_plane_url is also set +;rudderstack_sdk_url = + +# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config +;rudderstack_config_url = + +# Controls if the UI contains any links to user feedback forms +;feedback_links_enabled = true + +#################################### Security #################################### +[security] +# disable creation of admin user on first start of grafana +;disable_initial_admin_creation = false + +# default admin user, created on startup +;admin_user = admin + +# default admin password, can be changed before first start of grafana, or in profile settings +;admin_password = admin + +# used for signing +;secret_key = SW2YcwTIb9zpOOhoPsMm + +# current key provider used for envelope encryption, default to static value specified by secret_key +;encryption_provider = secretKey.v1 + +# list of configured key providers, space separated (Enterprise only): e.g., awskms.v1 azurekv.v1 +;available_encryption_providers = + +# disable gravatar profile images +;disable_gravatar = false + +# data source proxy whitelist (ip_or_domain:port separated by spaces) +;data_source_proxy_whitelist = + +# disable protection against brute force login attempts +;disable_brute_force_login_protection = false + +# set to true if you host Grafana behind HTTPS. default is false. +;cookie_secure = false + +# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled" +;cookie_samesite = lax + +# set to true if you want to allow browsers to render Grafana in a ,