Skip to content

Commit 78d9375

Browse files
committed
feat(node): Vendor in @fastify/otel
1 parent 61940fc commit 78d9375

File tree

7 files changed

+532
-12
lines changed

7 files changed

+532
-12
lines changed

packages/node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"access": "public"
6666
},
6767
"dependencies": {
68-
"@fastify/otel": "https://codeload.github.com/getsentry/fastify-otel/tar.gz/ae3088d65e286bdc94ac5d722573537d6a6671bb",
6968
"@opentelemetry/api": "^1.9.0",
7069
"@opentelemetry/context-async-hooks": "^1.30.1",
7170
"@opentelemetry/core": "^1.30.1",

packages/node/rollup.npm.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import commonjs from '@rollup/plugin-commonjs';
12
import replace from '@rollup/plugin-replace';
23
import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sentry-internal/rollup-utils';
34
import { createWorkerCodeBuilder } from './rollup.anr-worker.config.mjs';
@@ -27,6 +28,7 @@ export default [
2728
preserveModules: true,
2829
},
2930
plugins: [
31+
commonjs(),
3032
replace({
3133
delimiters: ['###', '###'],
3234
// removes some rollup warnings
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
2+
/// <reference types="node" />
3+
4+
import type { InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
5+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
6+
import type { FastifyPluginCallback } from 'fastify';
7+
import type { FastifyOtelInstrumentationOpts, FastifyOtelOptions, FastifyOtelRequestContext } from './types';
8+
9+
declare module 'fastify' {
10+
interface FastifyRequest {
11+
opentelemetry(): FastifyOtelRequestContext;
12+
}
13+
}
14+
15+
declare class FastifyOtelInstrumentation<
16+
Config extends FastifyOtelInstrumentationOpts = FastifyOtelInstrumentationOpts,
17+
> extends InstrumentationBase<Config> {
18+
servername: string;
19+
constructor(config?: FastifyOtelInstrumentationOpts);
20+
init(): InstrumentationNodeModuleDefinition[];
21+
plugin(): FastifyPluginCallback<FastifyOtelOptions>;
22+
}
23+
24+
declare namespace exported {
25+
export type { FastifyOtelInstrumentationOpts };
26+
export { FastifyOtelInstrumentation };
27+
}
28+
29+
export = exported;

0 commit comments

Comments
 (0)