Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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+`.

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
Loading