Skip to content

Commit

Permalink
docs(instrumentation-fastify): deprecate instrumentation in favor of …
Browse files Browse the repository at this point in the history
…@fastify/otel (#2651)

Co-authored-by: Trent Mick <trentm@gmail.com>
  • Loading branch information
pichlermarc and trentm authored Jan 27, 2025
1 parent 45c55a6 commit fcca38a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions plugins/node/opentelemetry-instrumentation-fastify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FastifyInstrumentationConfig> {
constructor(config: FastifyInstrumentationConfig = {}) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
Expand Down
5 changes: 4 additions & 1 deletion scripts/lint-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit fcca38a

Please sign in to comment.