diff --git a/plugins/node/opentelemetry-instrumentation-fastify/README.md b/plugins/node/opentelemetry-instrumentation-fastify/README.md index 51b7dcccfc..14c959fc65 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 June 30, 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.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+`. 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); diff --git a/scripts/lint-readme.js b/scripts/lint-readme.js index 78dd0d4b5e..cdc5e6988d 100644 --- a/scripts/lint-readme.js +++ b/scripts/lint-readme.js @@ -7,6 +7,9 @@ const monorepoRoot = path.resolve(__dirname, '..'); 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); @@ -74,7 +77,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(