@@ -32,17 +32,19 @@ SOFTWARE.
32
32
*/
33
33
34
34
/* 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 {
42
43
ATTR_HTTP_REQUEST_METHOD ,
44
+ ATTR_HTTP_RESPONSE_STATUS_CODE ,
45
+ ATTR_HTTP_ROUTE ,
43
46
ATTR_SERVICE_NAME ,
44
- } = require ( '@opentelemetry/semantic-conventions' ) ;
45
- const { InstrumentationBase } = require ( '@opentelemetry/instrumentation' ) ;
47
+ } from '@opentelemetry/semantic-conventions' ;
46
48
47
49
// SENTRY VENDOR NOTE
48
50
// 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');
82
84
const kSetNotFoundOriginal = Symbol ( 'fastify otel setnotfound original' ) ;
83
85
const kIgnorePaths = Symbol ( 'fastify otel ignore path' ) ;
84
86
85
- class FastifyOtelInstrumentation extends InstrumentationBase {
87
+ export class FastifyOtelInstrumentation extends InstrumentationBase {
86
88
constructor ( config ) {
87
89
super ( PACKAGE_NAME , PACKAGE_VERSION , config ) ;
88
90
this . servername = config ?. servername ?? process . env . OTEL_SERVICE_NAME ?? 'fastify' ;
@@ -488,6 +490,3 @@ class FastifyOtelInstrumentation extends InstrumentationBase {
488
490
}
489
491
}
490
492
}
491
-
492
- module . exports = FastifyOtelInstrumentation ;
493
- module . exports . FastifyOtelInstrumentation = FastifyOtelInstrumentation ;
0 commit comments