From c112575bd2aa5ffaecc5ceab1767f3892380f4a3 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 16 Jan 2025 16:34:25 +0100 Subject: [PATCH 1/5] docs(instrumentation-fastify): deprecate instrumentation in favor of @fastify/otel --- .../node/opentelemetry-instrumentation-fastify/README.md | 8 ++++++-- .../src/instrumentation.ts | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-fastify/README.md b/plugins/node/opentelemetry-instrumentation-fastify/README.md index 51b7dcccfc..67ae659698 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/README.md +++ b/plugins/node/opentelemetry-instrumentation-fastify/README.md @@ -3,9 +3,13 @@ [![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image] -This module provides automatic instrumentation for the [`fastify`](https://www.fastify.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. +> [!IMPORTANT] +> This component is **deprecated** in favor of the official instrumentation package [`@fastify/otel`](https://www.npmjs.com/package/@fastify/otel), maintained by the Fastify authors. +> Please see [here](https://github.com/fastify/otel?tab=readme-ov-file#usage) for instructions on how to use `@fastify/otel`. +> +> We will stop publishing new versions of `@opentelemetry/instrumentation-fastify` on March 25, 2025. -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. +This module provides automatic instrumentation for the [`fastify`](https://www.fastify.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. Compatible with OpenTelemetry JS API and SDK `1.0+`. diff --git a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts index 0ccc2c3a44..f944be00f1 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts @@ -47,7 +47,11 @@ import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; export const ANONYMOUS_NAME = 'anonymous'; -/** Fastify instrumentation for OpenTelemetry */ +/** + * Fastify instrumentation for OpenTelemetry + * @deprecated This instrumentation is deprecated in favor of the official instrumentation package `@fastify/otel`, + * which is maintained by the fastify authors. + */ export class FastifyInstrumentation extends InstrumentationBase { constructor(config: FastifyInstrumentationConfig = {}) { super(PACKAGE_NAME, PACKAGE_VERSION, config); From 9194d41ff0c353ea6d1337d350cdb62663213d73 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 16 Jan 2025 17:26:53 +0100 Subject: [PATCH 2/5] chore(lint-readme): filter fastify from dependency list --- scripts/lint-readme.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lint-readme.js b/scripts/lint-readme.js index 78dd0d4b5e..820fc1f97f 100644 --- a/scripts/lint-readme.js +++ b/scripts/lint-readme.js @@ -4,7 +4,7 @@ const path = require('path'); const packageRoot = process.cwd(); const monorepoRoot = path.resolve(__dirname, '..'); -const autoInstrumentationNodeDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-node/package.json`).dependencies; +const autoInstrumentationNodeDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-node/package.json`).dependencies.filter(dep => dep !== '@opentelemetry/instrumentation-fastify'); const autoInstrumentationWebDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-web/package.json`).dependencies; // extract info from package.json @@ -74,7 +74,7 @@ Compatible with OpenTelemetry JS API and SDK \`1.0+\`. const distText = `If total installation size is not constrained, it is recommended to use the [\`@opentelemetry/auto-instrumentations-web\`](https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-web) bundle with [\`@opentelemetry/sdk-trace-web\`](https://www.npmjs.com/package/@opentelemetry/sdk-trace-web) for the most seamless instrumentation experience. Compatible with OpenTelemetry JS API and SDK \`1.0+\`. -`; +`; if (!currentReadmeContent.includes(distText)) { throw new Error( From c141c5250f907ef6570e1fe0d32e926b7d5823b9 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 16 Jan 2025 17:37:21 +0100 Subject: [PATCH 3/5] fixup! chore(lint-readme): filter fastify from dependency list --- scripts/lint-readme.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/lint-readme.js b/scripts/lint-readme.js index 820fc1f97f..cdc5e6988d 100644 --- a/scripts/lint-readme.js +++ b/scripts/lint-readme.js @@ -4,9 +4,12 @@ const path = require('path'); const packageRoot = process.cwd(); const monorepoRoot = path.resolve(__dirname, '..'); -const autoInstrumentationNodeDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-node/package.json`).dependencies.filter(dep => dep !== '@opentelemetry/instrumentation-fastify'); +const autoInstrumentationNodeDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-node/package.json`).dependencies; const autoInstrumentationWebDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-web/package.json`).dependencies; +// remove exempt instrumentations +delete autoInstrumentationNodeDeps['@opentelemetry/instrumentation-fastify']; + // extract info from package.json const packageJsonUrl = path.resolve(`${packageRoot}/package.json`); const pjson = require(packageJsonUrl); From 8bcc68ba8c2af27ef00ccd71f353c6c9bd26f223 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 23 Jan 2025 10:00:45 +0100 Subject: [PATCH 4/5] Update plugins/node/opentelemetry-instrumentation-fastify/README.md --- plugins/node/opentelemetry-instrumentation-fastify/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-fastify/README.md b/plugins/node/opentelemetry-instrumentation-fastify/README.md index 67ae659698..fada686907 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/README.md +++ b/plugins/node/opentelemetry-instrumentation-fastify/README.md @@ -7,7 +7,7 @@ > This component is **deprecated** in favor of the official instrumentation package [`@fastify/otel`](https://www.npmjs.com/package/@fastify/otel), maintained by the Fastify authors. > Please see [here](https://github.com/fastify/otel?tab=readme-ov-file#usage) for instructions on how to use `@fastify/otel`. > -> We will stop publishing new versions of `@opentelemetry/instrumentation-fastify` on March 25, 2025. +> We will stop publishing new versions of `@opentelemetry/instrumentation-fastify` on June 30, 2025. This module provides automatic instrumentation for the [`fastify`](https://www.fastify.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. From 7c902492c4d2f0f8fdfb1a10b77a4cf5559c1651 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Mon, 27 Jan 2025 11:14:39 +0100 Subject: [PATCH 5/5] Update plugins/node/opentelemetry-instrumentation-fastify/README.md Co-authored-by: Trent Mick --- plugins/node/opentelemetry-instrumentation-fastify/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-fastify/README.md b/plugins/node/opentelemetry-instrumentation-fastify/README.md index fada686907..14c959fc65 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/README.md +++ b/plugins/node/opentelemetry-instrumentation-fastify/README.md @@ -9,7 +9,7 @@ > > We will stop publishing new versions of `@opentelemetry/instrumentation-fastify` on June 30, 2025. -This module provides automatic instrumentation for the [`fastify`](https://www.fastify.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. +This module provides automatic instrumentation for the [`fastify`](https://www.fastify.dev/) 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. Compatible with OpenTelemetry JS API and SDK `1.0+`.