Skip to content

Commit b6f68fa

Browse files
Addressing linting errors
1 parent e9cf19b commit b6f68fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/telemetry/instrumentations.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { IncomingMessage} from 'http';
2+
3+
import type { Request } from 'express';
14
import type { Instrumentation } from '@opentelemetry/instrumentation';
25
import { DnsInstrumentation } from '@opentelemetry/instrumentation-dns';
36
import { ExpressInstrumentation, ExpressInstrumentationConfig } from '@opentelemetry/instrumentation-express';
@@ -8,9 +11,6 @@ import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
811
import { NetInstrumentation } from '@opentelemetry/instrumentation-net';
912
import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
1013
import { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';
11-
import { Span } from '@opentelemetry/api';
12-
import { IncomingMessage, ClientRequest } from 'http';
13-
import { Request } from 'express';
1414

1515
const InstrumentationMap = {
1616
'@opentelemetry/instrumentation-http': HttpInstrumentation,
@@ -74,7 +74,7 @@ export function getAutoInstrumentations(
7474
expressConfig.requestHook = (span, req) => {
7575
const method = req.request?.method || 'UNKNOWN';
7676
// Use the matched route path instead of raw URL if available
77-
const route = (req.request as any).route?.path || req.request?.url?.split('?')[0] || '/';
77+
const route = (req.request as Request).route?.path || req.request?.url?.split('?')[0] || '/';
7878
span.updateName(createSpanName(method, route));
7979
};
8080
}

0 commit comments

Comments
 (0)