Skip to content

Commit 9377a2a

Browse files
authored
fix(knex-instrumentation): use correct db system attribute
for users who use a custom dialect themselves or via ORM (example MikroORM)
1 parent 4b9e3ad commit 9377a2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/instrumentation-knex/src/instrumentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class KnexInstrumentation extends InstrumentationBase<KnexInstrumentation
161161

162162
if (instrumentation._semconvStability & SemconvStability.OLD) {
163163
Object.assign(attributes, {
164-
[ATTR_DB_SYSTEM]: utils.mapSystem(config.client),
164+
[ATTR_DB_SYSTEM]: utils.mapSystem(this.client.driverName),
165165
[ATTR_DB_SQL_TABLE]: table,
166166
[ATTR_DB_OPERATION]: operation,
167167
[ATTR_DB_USER]: config?.connection?.user,
@@ -173,7 +173,7 @@ export class KnexInstrumentation extends InstrumentationBase<KnexInstrumentation
173173
}
174174
if (instrumentation._semconvStability & SemconvStability.STABLE) {
175175
Object.assign(attributes, {
176-
[ATTR_DB_SYSTEM_NAME]: utils.mapSystem(config.client),
176+
[ATTR_DB_SYSTEM_NAME]: utils.mapSystem(this.client.driverName),
177177
[ATTR_DB_COLLECTION_NAME]: table,
178178
[ATTR_DB_OPERATION_NAME]: operation,
179179
[ATTR_DB_NAMESPACE]: name,

0 commit comments

Comments
 (0)