@@ -32,17 +32,19 @@ SOFTWARE.
3232*/
3333
3434/* eslint-disable @typescript-eslint/explicit-member-accessibility */
35- 'use strict' ;
36- const dc = require ( 'node:diagnostics_channel' ) ;
37- const { context, trace, SpanStatusCode, propagation, diag } = require ( '@opentelemetry/api' ) ;
38- const { getRPCMetadata, RPCType } = require ( '@opentelemetry/core' ) ;
39- const {
40- ATTR_HTTP_ROUTE ,
41- ATTR_HTTP_RESPONSE_STATUS_CODE ,
35+ /* eslint-disable jsdoc/require-jsdoc */
36+ /* eslint-disable max-lines */
37+ /* eslint-disable no-param-reassign */
38+ import dc from 'node:diagnostics_channel' ;
39+ import { context , propagation , SpanStatusCode , trace } from '@opentelemetry/api' ;
40+ import { getRPCMetadata , RPCType } from '@opentelemetry/core' ;
41+ import { InstrumentationBase } from '@opentelemetry/instrumentation' ;
42+ import {
4243 ATTR_HTTP_REQUEST_METHOD ,
44+ ATTR_HTTP_RESPONSE_STATUS_CODE ,
45+ ATTR_HTTP_ROUTE ,
4346 ATTR_SERVICE_NAME ,
44- } = require ( '@opentelemetry/semantic-conventions' ) ;
45- const { InstrumentationBase } = require ( '@opentelemetry/instrumentation' ) ;
47+ } from '@opentelemetry/semantic-conventions' ;
4648
4749// SENTRY VENDOR NOTE
4850// Instead of using the package.json file, we hard code the package name and version here.
@@ -82,7 +84,7 @@ const kAddHookOriginal = Symbol('fastify otel addhook original');
8284const kSetNotFoundOriginal = Symbol ( 'fastify otel setnotfound original' ) ;
8385const kIgnorePaths = Symbol ( 'fastify otel ignore path' ) ;
8486
85- class FastifyOtelInstrumentation extends InstrumentationBase {
87+ export class FastifyOtelInstrumentation extends InstrumentationBase {
8688 constructor ( config ) {
8789 super ( PACKAGE_NAME , PACKAGE_VERSION , config ) ;
8890 this . servername = config ?. servername ?? process . env . OTEL_SERVICE_NAME ?? 'fastify' ;
@@ -488,6 +490,3 @@ class FastifyOtelInstrumentation extends InstrumentationBase {
488490 }
489491 }
490492}
491-
492- module . exports = FastifyOtelInstrumentation ;
493- module . exports . FastifyOtelInstrumentation = FastifyOtelInstrumentation ;
0 commit comments