Skip to content

Commit fcca38a

Browse files
pichlermarctrentm
andauthored
docs(instrumentation-fastify): deprecate instrumentation in favor of @fastify/otel (#2651)
Co-authored-by: Trent Mick <[email protected]>
1 parent 45c55a6 commit fcca38a

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

plugins/node/opentelemetry-instrumentation-fastify/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
[![NPM Published Version][npm-img]][npm-url]
44
[![Apache License][license-image]][license-image]
55

6-
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.
6+
> [!IMPORTANT]
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.
8+
> Please see [here](https://github.com/fastify/otel?tab=readme-ov-file#usage) for instructions on how to use `@fastify/otel`.
9+
>
10+
> We will stop publishing new versions of `@opentelemetry/instrumentation-fastify` on June 30, 2025.
711
8-
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.
12+
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.
913

1014
Compatible with OpenTelemetry JS API and SDK `1.0+`.
1115

plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ import { PACKAGE_NAME, PACKAGE_VERSION } from './version';
4747

4848
export const ANONYMOUS_NAME = 'anonymous';
4949

50-
/** Fastify instrumentation for OpenTelemetry */
50+
/**
51+
* Fastify instrumentation for OpenTelemetry
52+
* @deprecated This instrumentation is deprecated in favor of the official instrumentation package `@fastify/otel`,
53+
* which is maintained by the fastify authors.
54+
*/
5155
export class FastifyInstrumentation extends InstrumentationBase<FastifyInstrumentationConfig> {
5256
constructor(config: FastifyInstrumentationConfig = {}) {
5357
super(PACKAGE_NAME, PACKAGE_VERSION, config);

scripts/lint-readme.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const monorepoRoot = path.resolve(__dirname, '..');
77
const autoInstrumentationNodeDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-node/package.json`).dependencies;
88
const autoInstrumentationWebDeps = require(`${monorepoRoot}/metapackages/auto-instrumentations-web/package.json`).dependencies;
99

10+
// remove exempt instrumentations
11+
delete autoInstrumentationNodeDeps['@opentelemetry/instrumentation-fastify'];
12+
1013
// extract info from package.json
1114
const packageJsonUrl = path.resolve(`${packageRoot}/package.json`);
1215
const pjson = require(packageJsonUrl);
@@ -74,7 +77,7 @@ Compatible with OpenTelemetry JS API and SDK \`1.0+\`.
7477
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.
7578
7679
Compatible with OpenTelemetry JS API and SDK \`1.0+\`.
77-
`;
80+
`;
7881

7982
if (!currentReadmeContent.includes(distText)) {
8083
throw new Error(

0 commit comments

Comments
 (0)