From 97ebd4fbc891811dd17c6d2a425911dcc39a3e62 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Sun, 1 Dec 2024 08:51:45 -0800 Subject: [PATCH 1/3] chore(aws-sdk): add @trivikr as component owner (#2557) Co-authored-by: Marc Pichler --- .github/component_owners.yml | 1 + plugins/node/opentelemetry-instrumentation-aws-sdk/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/component_owners.yml b/.github/component_owners.yml index d688e6f833..ac8556dbdc 100644 --- a/.github/component_owners.yml +++ b/.github/component_owners.yml @@ -74,6 +74,7 @@ components: plugins/node/opentelemetry-instrumentation-aws-sdk: - blumamir - jj22ee + - trivikr plugins/node/opentelemetry-instrumentation-bunyan: - seemk - trentm diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/README.md b/plugins/node/opentelemetry-instrumentation-aws-sdk/README.md index 0538603631..ea51d907d4 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/README.md +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/README.md @@ -3,7 +3,7 @@ [![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image] -[component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @blumamir @jj22ee +[component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @blumamir @jj22ee @trivikr This module provides automatic instrumentation for the [`aws-sdk` v2](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/) and [`@aws-sdk` v3](https://github.com/aws/aws-sdk-js-v3) modules, 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. From bf8117e541c42616cb2e39399cbdc3bdbf3d5013 Mon Sep 17 00:00:00 2001 From: David Luna Date: Mon, 2 Dec 2024 15:50:42 +0100 Subject: [PATCH 2/3] chore(instr-koa): update instrumentation-koa tests (#2566) --- package-lock.json | 2 ++ .../.tav.yml | 14 ++++++--- .../package.json | 1 + .../test/koa.test.ts | 30 +++++++++++++++---- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03be175022..f50df50692 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37509,6 +37509,7 @@ "koa": "2.13.1", "nyc": "15.1.0", "rimraf": "5.0.10", + "semver": "7.6.3", "sinon": "15.2.0", "test-all-versions": "6.1.0", "typescript": "4.4.4" @@ -48092,6 +48093,7 @@ "koa": "2.13.1", "nyc": "15.1.0", "rimraf": "5.0.10", + "semver": "7.6.3", "sinon": "15.2.0", "test-all-versions": "6.1.0", "typescript": "4.4.4" diff --git a/plugins/node/opentelemetry-instrumentation-koa/.tav.yml b/plugins/node/opentelemetry-instrumentation-koa/.tav.yml index 973c1fb861..d329351f69 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-koa/.tav.yml @@ -1,8 +1,14 @@ "@koa/router": - versions: - include: ">=8.0.0" - mode: latest-minors - commands: npm run test + jobs: + - versions: + include: ">=8.0.0 <13" + mode: latest-minors + commands: npm run test + - versions: + include: ">=13 <14" + mode: latest-minors + node: '>=18' + commands: npm run test koa: # Testing ^2.7.0 covers at least 97% of the downloaded koa versions diff --git a/plugins/node/opentelemetry-instrumentation-koa/package.json b/plugins/node/opentelemetry-instrumentation-koa/package.json index 1c26caa48d..7a75a46804 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/package.json +++ b/plugins/node/opentelemetry-instrumentation-koa/package.json @@ -60,6 +60,7 @@ "koa": "2.13.1", "nyc": "15.1.0", "rimraf": "5.0.10", + "semver": "7.6.3", "sinon": "15.2.0", "test-all-versions": "6.1.0", "typescript": "4.4.4" diff --git a/plugins/node/opentelemetry-instrumentation-koa/test/koa.test.ts b/plugins/node/opentelemetry-instrumentation-koa/test/koa.test.ts index a40cd033c1..c1b894a026 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/test/koa.test.ts +++ b/plugins/node/opentelemetry-instrumentation-koa/test/koa.test.ts @@ -41,6 +41,7 @@ import * as assert from 'assert'; import * as koa from 'koa'; import * as http from 'http'; import * as sinon from 'sinon'; +import * as semver from 'semver'; import { AddressInfo } from 'net'; import { KoaLayerType, KoaRequestInfo } from '../src/types'; import { AttributeNames } from '../src/enums/AttributeNames'; @@ -65,7 +66,13 @@ const httpRequest = { }, }; -describe('Koa Instrumentation', () => { +const LIB_VERSION = require('@koa/router/package.json').version; +const NODE_VERSION = process.version; +const isrouterCompat = + semver.lt(LIB_VERSION, '13.0.0') || + (semver.gte(LIB_VERSION, '13.0.0') && semver.gte(NODE_VERSION, '18.0.0')); + +describe('Koa Instrumentation', function () { const provider = new NodeTracerProvider(); const memoryExporter = new InMemorySpanExporter(); const spanProcessor = new SimpleSpanProcessor(memoryExporter); @@ -77,7 +84,7 @@ describe('Koa Instrumentation', () => { let server: http.Server; let port: number; - before(() => { + before(function () { plugin.enable(); }); @@ -141,7 +148,13 @@ describe('Koa Instrumentation', () => { yield next; }; - describe('Instrumenting @koa/router calls', () => { + describe('Instrumenting @koa/router calls', function () { + before(function () { + if (!isrouterCompat) { + this.skip(); + } + }); + it('should create a child span for middlewares (string route)', async () => { const rootSpan = tracer.startSpan('rootSpan'); const rpcMetadata: RPCMetadata = { type: RPCType.HTTP, span: rootSpan }; @@ -585,7 +598,13 @@ describe('Koa Instrumentation', () => { }); }); - describe('Using requestHook', () => { + describe('Using requestHook', function () { + before(function () { + if (!isrouterCompat) { + this.skip(); + } + }); + it('should ignore requestHook which throws exception', async () => { const rootSpan = tracer.startSpan('rootSpan'); const rpcMetadata = { type: RPCType.HTTP, span: rootSpan }; @@ -721,7 +740,8 @@ describe('Koa Instrumentation', () => { }); }); - it('should work with ESM usage', async () => { + const itFn = isrouterCompat ? it : it.skip; + itFn('should work with ESM usage', async () => { await testUtils.runTestFixture({ cwd: __dirname, argv: ['fixtures/use-koa.mjs'], From 8bfa21feda79cab00a42b6a1bb30f87eb7935841 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:00:36 -0800 Subject: [PATCH 3/3] fix(docs): broken link for community contribution lifecycle and processes (#2576) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- CONTRIBUTING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8a17e1d13d..deea23fa1d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ Before creating a pull request, please make sure: - You have read the guide for contributing - See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md - You signed all your commits (otherwise we won't be able to merge the PR) - - See https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md#sign-the-cla + - See https://github.com/open-telemetry/community/blob/main/guides/contributor#sign-the-cla - You added unit tests for the new functionality - You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close the issue that your PR fixes (if such) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3cbc3f38e..cd9be4f60e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,7 @@ git merge upstream/main Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main. -Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md#github-workflow) section of general project contributing guide. +Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#github-workflow) section of general project contributing guide. ## Development