1
- import { InstrumentationBase , InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation' ;
1
+ import { InstrumentationBase , InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation' ;
2
2
import type { HandlerInterface , Hono , HonoInstance , MiddlewareHandlerInterface , OnHandlerInterface } from './types' ;
3
3
4
4
const PACKAGE_NAME = '@sentry/instrumentation-hono' ;
@@ -17,11 +17,7 @@ export class HonoInstrumentation extends InstrumentationBase {
17
17
*/
18
18
public init ( ) : InstrumentationNodeModuleDefinition [ ] {
19
19
return [
20
- new InstrumentationNodeModuleDefinition (
21
- 'hono' ,
22
- [ '>=4.0.0 <5' ] ,
23
- moduleExports => this . _patch ( moduleExports ) ,
24
- ) ,
20
+ new InstrumentationNodeModuleDefinition ( 'hono' , [ '>=4.0.0 <5' ] , moduleExports => this . _patch ( moduleExports ) ) ,
25
21
] ;
26
22
}
27
23
@@ -54,7 +50,7 @@ export class HonoInstrumentation extends InstrumentationBase {
54
50
* Patches the route handler to instrument it.
55
51
*/
56
52
private _patchHandler ( ) : ( original : HandlerInterface ) => HandlerInterface {
57
- return function ( original : HandlerInterface ) {
53
+ return function ( original : HandlerInterface ) {
58
54
return function wrappedHandler ( this : HonoInstance , ...args : unknown [ ] ) {
59
55
// TODO: Add OpenTelemetry tracing logic here
60
56
return original . apply ( this , args ) ;
@@ -66,7 +62,7 @@ export class HonoInstrumentation extends InstrumentationBase {
66
62
* Patches the 'on' handler to instrument it.
67
63
*/
68
64
private _patchOnHandler ( ) : ( original : OnHandlerInterface ) => OnHandlerInterface {
69
- return function ( original : OnHandlerInterface ) {
65
+ return function ( original : OnHandlerInterface ) {
70
66
return function wrappedHandler ( this : HonoInstance , ...args : unknown [ ] ) {
71
67
// TODO: Add OpenTelemetry tracing logic here
72
68
return original . apply ( this , args ) ;
@@ -78,7 +74,7 @@ export class HonoInstrumentation extends InstrumentationBase {
78
74
* Patches the middleware handler to instrument it.
79
75
*/
80
76
private _patchMiddlewareHandler ( ) : ( original : MiddlewareHandlerInterface ) => MiddlewareHandlerInterface {
81
- return function ( original : MiddlewareHandlerInterface ) {
77
+ return function ( original : MiddlewareHandlerInterface ) {
82
78
return function wrappedHandler ( this : HonoInstance , ...args : unknown [ ] ) {
83
79
// TODO: Add OpenTelemetry tracing logic here
84
80
return original . apply ( this , args ) ;
0 commit comments