Skip to content

Commit df1bb5f

Browse files
committed
use proper types, remove unnecessary filter
1 parent f6b8517 commit df1bb5f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

plugins/node/instrumentation-sequelize/src/instrumentation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
SpanStatusCode,
2222
trace,
2323
diag,
24+
Attributes,
2425
} from '@opentelemetry/api';
2526
import { suppressTracing } from '@opentelemetry/core';
2627
import {
@@ -162,8 +163,7 @@ export class SequelizeInstrumentation extends InstrumentationBase<SequelizeInstr
162163
else tableName = extractTableFromQuery(statement);
163164
}
164165

165-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
166-
const attributes: Record<string, any> = {
166+
const attributes: Attributes = {
167167
[ATTR_DB_SYSTEM_NAME]: sequelizeInstance.getDialect(),
168168
[ATTR_DB_NAMESPACE]: config?.database,
169169
[ATTR_DB_OPERATION_NAME]: operation,
@@ -174,10 +174,6 @@ export class SequelizeInstrumentation extends InstrumentationBase<SequelizeInstr
174174
[ATTR_NETWORK_TRANSPORT]: self._getNetTransport(config?.protocol),
175175
};
176176

177-
Object.entries(attributes).forEach(([key, value]) => {
178-
if (value === undefined) delete attributes[key];
179-
});
180-
181177
const newSpan: Span = self.tracer.startSpan(`Sequelize ${operation}`, {
182178
kind: SpanKind.CLIENT,
183179
attributes,

0 commit comments

Comments
 (0)