From adb9077724e74d10254f52e95e20b7e1efb9babd Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 8 Oct 2026 09:55:39 +0200 Subject: [PATCH 1/2] test(node): Port Knex integration tests to span streaming Co-Authored-By: GPT-6 --- .../knex/mysql2/instrument-span-streaming.mjs | 10 - .../suites/tracing/knex/mysql2/instrument.mjs | 1 - .../suites/tracing/knex/mysql2/test.ts | 152 +++++++-------- .../knex/pg/instrument-span-streaming.mjs | 10 - .../suites/tracing/knex/pg/instrument.mjs | 1 - .../suites/tracing/knex/pg/test.ts | 180 ++++++++---------- 6 files changed, 157 insertions(+), 197 deletions(-) delete mode 100644 dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument-span-streaming.mjs delete mode 100644 dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument-span-streaming.mjs diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument-span-streaming.mjs b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument-span-streaming.mjs deleted file mode 100644 index 53b9511a21f0..000000000000 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument-span-streaming.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import * as Sentry from '@sentry/node'; -import { loggingTransport } from '@sentry-internal/node-integration-tests'; - -Sentry.init({ - dsn: 'https://public@dsn.ingest.sentry.io/1337', - release: '1.0', - tracesSampleRate: 1.0, - transport: loggingTransport, - traceLifecycle: 'stream', -}); diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument.mjs index 170ad6f6a702..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/instrument.mjs @@ -2,7 +2,6 @@ import * as Sentry from '@sentry/node'; import { loggingTransport } from '@sentry-internal/node-integration-tests'; Sentry.init({ - traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', release: '1.0', tracesSampleRate: 1.0, diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts index 98cb1127906b..aebef60c8be5 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts @@ -1,3 +1,15 @@ +import { + DB_NAMESPACE, + DB_OPERATION_NAME, + DB_QUERY_SUMMARY, + DB_QUERY_TEXT, + DB_SYSTEM_NAME, + DB_USER, + SENTRY_OP, + SENTRY_ORIGIN, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import { describe, expect } from 'vitest'; import { createEsmAndCjsTests, describeWithDockerCompose } from '../../../../utils/runner'; @@ -9,93 +21,75 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di describe('with `mysql2` client', () => { createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => { test('should auto-instrument `knex` package', { timeout: 60_000 }, async () => { - const EXPECTED_TRANSACTION = { - transaction: 'Test Transaction', - spans: expect.arrayContaining([ - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.system.name': 'mysql2', - 'db.namespace': 'tests', - 'db.user': 'root', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - 'server.address': 'localhost', - 'server.port': 3307, - }), - status: 'ok', - description: - 'create table `User` (`id` int unsigned not null auto_increment primary key, `createdAt` timestamp(?) not null default CURRENT_TIMESTAMP(?), `email` text not null, `name` text not null)', - origin: ORIGIN, + const EXPECTED_SPANS = [ + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'mysql2' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [DB_USER]: { type: 'string', value: 'root' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, + [SERVER_PORT]: { type: 'integer', value: 3307 }, + [DB_QUERY_TEXT]: { + type: 'string', + value: + 'create table `User` (`id` int unsigned not null auto_increment primary key, `createdAt` timestamp(?) not null default CURRENT_TIMESTAMP(?), `email` text not null, `name` text not null)', + }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'create table `User`' }, }), - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.system.name': 'mysql2', - 'db.namespace': 'tests', - 'db.user': 'root', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - 'server.address': 'localhost', - 'server.port': 3307, - }), - status: 'ok', - description: 'insert into `User` (`email`, `name`) values (?, ?)', - origin: ORIGIN, + status: 'ok', + name: 'create table `User`', + }), + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'mysql2' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [DB_USER]: { type: 'string', value: 'root' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, + [SERVER_PORT]: { type: 'integer', value: 3307 }, + [DB_QUERY_TEXT]: { type: 'string', value: 'insert into `User` (`email`, `name`) values (?, ?)' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'insert `User`' }, }), + status: 'ok', + name: 'insert `User`', + }), - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.operation.name': 'select', - 'db.sql.table': 'User', - 'db.system.name': 'mysql2', - 'db.namespace': 'tests', - 'db.query.text': 'select * from `User`', - 'db.user': 'root', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - }), - status: 'ok', - description: 'select * from `User`', - origin: ORIGIN, + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_OPERATION_NAME]: { type: 'string', value: 'select' }, + 'db.sql.table': { type: 'string', value: 'User' }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'mysql2' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [DB_QUERY_TEXT]: { type: 'string', value: 'select * from `User`' }, + [DB_USER]: { type: 'string', value: 'root' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'select `User`' }, }), - ]), - }; - - await createRunner().expect({ transaction: EXPECTED_TRANSACTION }).start().completed(); - }); - }); + status: 'ok', + name: 'select `User`', + }), + expect.objectContaining({ + attributes: expect.objectContaining({ + [DB_QUERY_TEXT]: { type: 'string', value: 'drop table `User`' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'drop table `User`' }, + }), + name: 'drop table `User`', + }), + ]; - createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument-span-streaming.mjs', (createRunner, test) => { - test('should name spans after the query summary with span streaming', { timeout: 60_000 }, async () => { await createRunner() .expect({ span: container => { - // The `mysql2` driver spans underneath the knex spans come from a different integration and - // are named after the full statement, so they are filtered out here. - const knexSpans = container.items.filter(item => item.attributes['sentry.origin']?.value === ORIGIN); - - expect( - knexSpans.map(span => ({ - name: span.name, - summary: span.attributes['db.query.summary']?.value, - text: span.attributes['db.query.text']?.value, - })), - ).toEqual([ - { - name: 'create table `User`', - summary: 'create table `User`', - text: 'create table `User` (`id` int unsigned not null auto_increment primary key, `createdAt` timestamp(?) not null default CURRENT_TIMESTAMP(?), `email` text not null, `name` text not null)', - }, - { - name: 'insert `User`', - summary: 'insert `User`', - text: 'insert into `User` (`email`, `name`) values (?, ?)', - }, - { name: 'select `User`', summary: 'select `User`', text: 'select * from `User`' }, - { name: 'drop table `User`', summary: 'drop table `User`', text: 'drop table `User`' }, - ]); + expect(container.items.find(span => span.is_segment)?.name).toBe('Test Transaction'); + const knexSpans = container.items.filter(span => span.attributes[SENTRY_ORIGIN]?.value === ORIGIN); + expect(knexSpans).toEqual(EXPECTED_SPANS); }, }) .start() diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument-span-streaming.mjs b/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument-span-streaming.mjs deleted file mode 100644 index 53b9511a21f0..000000000000 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument-span-streaming.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import * as Sentry from '@sentry/node'; -import { loggingTransport } from '@sentry-internal/node-integration-tests'; - -Sentry.init({ - dsn: 'https://public@dsn.ingest.sentry.io/1337', - release: '1.0', - tracesSampleRate: 1.0, - transport: loggingTransport, - traceLifecycle: 'stream', -}); diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument.mjs b/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument.mjs index 170ad6f6a702..46a27dd03b74 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/knex/pg/instrument.mjs @@ -2,7 +2,6 @@ import * as Sentry from '@sentry/node'; import { loggingTransport } from '@sentry-internal/node-integration-tests'; Sentry.init({ - traceLifecycle: 'static', dsn: 'https://public@dsn.ingest.sentry.io/1337', release: '1.0', tracesSampleRate: 1.0, diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts index 5d1da5ad89ff..f2fdf76b8dee 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts @@ -1,3 +1,14 @@ +import { + DB_NAMESPACE, + DB_OPERATION_NAME, + DB_QUERY_SUMMARY, + DB_QUERY_TEXT, + DB_SYSTEM_NAME, + SENTRY_OP, + SENTRY_ORIGIN, + SERVER_ADDRESS, + SERVER_PORT, +} from '@sentry/conventions/attributes'; import { describe, expect } from 'vitest'; import { createEsmAndCjsTests, describeWithDockerCompose } from '../../../../utils/runner'; @@ -9,112 +20,89 @@ describe('knex auto instrumentation', () => { describeWithDockerCompose('with `pg` client', { workingDirectory: [__dirname] }, () => { createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => { test('should auto-instrument `knex` package', { timeout: 60_000 }, async () => { - const EXPECTED_TRANSACTION = { - transaction: 'Test Transaction', - spans: expect.arrayContaining([ - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.system.name': 'postgresql', - 'db.namespace': 'tests', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - 'server.address': 'localhost', - 'server.port': 5445, - }), - status: 'ok', - description: - 'create table "User" ("id" serial primary key, "createdAt" timestamptz(?) not null default CURRENT_TIMESTAMP(?), "email" text not null, "name" text not null)', - origin: ORIGIN, + const EXPECTED_SPANS = [ + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, + [SERVER_PORT]: { type: 'integer', value: 5445 }, + [DB_QUERY_TEXT]: { + type: 'string', + value: + 'create table "User" ("id" serial primary key, "createdAt" timestamptz(?) not null default CURRENT_TIMESTAMP(?), "email" text not null, "name" text not null)', + }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'create table "User"' }, }), - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.system.name': 'postgresql', - 'db.namespace': 'tests', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - 'server.address': 'localhost', - 'server.port': 5445, - }), - status: 'ok', - // In the knex-otel spans, the placeholders (e.g., `$1`) are replaced by a `?`. - description: 'insert into "User" ("email", "name") values (?, ?)', - origin: ORIGIN, + status: 'ok', + name: 'create table "User"', + }), + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, + [SERVER_PORT]: { type: 'integer', value: 5445 }, + [DB_QUERY_TEXT]: { type: 'string', value: 'insert into "User" ("email", "name") values (?, ?)' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'insert "User"' }, }), + status: 'ok', + // In the knex-otel spans, the placeholders (e.g., `$1`) are replaced by a `?`. + name: 'insert "User"', + }), - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.operation.name': 'select', - 'db.sql.table': 'User', - 'db.system.name': 'postgresql', - 'db.namespace': 'tests', - 'db.query.text': 'select * from "User"', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - }), - status: 'ok', - description: 'select * from "User"', - origin: ORIGIN, + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_OPERATION_NAME]: { type: 'string', value: 'select' }, + 'db.sql.table': { type: 'string', value: 'User' }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [DB_QUERY_TEXT]: { type: 'string', value: 'select * from "User"' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'select "User"' }, }), + status: 'ok', + name: 'select "User"', + }), - expect.objectContaining({ - data: expect.objectContaining({ - 'knex.version': KNEX_VERSION, - 'db.operation.name': 'select', - 'db.sql.table': 'DoesNotExist', - 'db.system.name': 'postgresql', - 'db.namespace': 'tests', - 'db.query.text': 'select * from "DoesNotExist"', - 'sentry.origin': ORIGIN, - 'sentry.op': 'db', - }), - status: 'internal_error', - description: 'select * from "DoesNotExist"', - origin: ORIGIN, + expect.objectContaining({ + attributes: expect.objectContaining({ + 'knex.version': { type: 'string', value: KNEX_VERSION }, + [DB_OPERATION_NAME]: { type: 'string', value: 'select' }, + 'db.sql.table': { type: 'string', value: 'DoesNotExist' }, + [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, + [DB_NAMESPACE]: { type: 'string', value: 'tests' }, + [DB_QUERY_TEXT]: { type: 'string', value: 'select * from "DoesNotExist"' }, + [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, + [SENTRY_OP]: { type: 'string', value: 'db' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'select "DoesNotExist"' }, }), - ]), - }; - - await createRunner().expect({ transaction: EXPECTED_TRANSACTION }).start().completed(); - }); - }); + status: 'error', + name: 'select "DoesNotExist"', + }), + expect.objectContaining({ + attributes: expect.objectContaining({ + [DB_QUERY_TEXT]: { type: 'string', value: 'drop table "User"' }, + [DB_QUERY_SUMMARY]: { type: 'string', value: 'drop table "User"' }, + }), + name: 'drop table "User"', + }), + ]; - createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument-span-streaming.mjs', (createRunner, test) => { - test('should name spans after the query summary with span streaming', { timeout: 60_000 }, async () => { await createRunner() .expect({ span: container => { - // The `pg` driver spans underneath the knex spans come from a different integration and - // are named after the full statement, so they are filtered out here. - const knexSpans = container.items.filter(item => item.attributes['sentry.origin']?.value === ORIGIN); - - expect( - knexSpans.map(span => ({ - name: span.name, - summary: span.attributes['db.query.summary']?.value, - text: span.attributes['db.query.text']?.value, - })), - ).toEqual([ - { - name: 'create table "User"', - summary: 'create table "User"', - text: 'create table "User" ("id" serial primary key, "createdAt" timestamptz(?) not null default CURRENT_TIMESTAMP(?), "email" text not null, "name" text not null)', - }, - { - name: 'insert "User"', - summary: 'insert "User"', - text: 'insert into "User" ("email", "name") values (?, ?)', - }, - { name: 'select "User"', summary: 'select "User"', text: 'select * from "User"' }, - { - name: 'select "DoesNotExist"', - summary: 'select "DoesNotExist"', - text: 'select * from "DoesNotExist"', - }, - { name: 'drop table "User"', summary: 'drop table "User"', text: 'drop table "User"' }, - ]); + expect(container.items.find(span => span.is_segment)?.name).toBe('Test Transaction'); + const knexSpans = container.items.filter(span => span.attributes[SENTRY_ORIGIN]?.value === ORIGIN); + expect(knexSpans).toEqual(EXPECTED_SPANS); }, }) .start() From ec7728e8d8811218f46e2d620b7d22cdab5dcd87 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 8 Oct 2026 11:03:34 +0200 Subject: [PATCH 2/2] test(node): Use conventions constants for span ops Co-Authored-By: GPT-6 --- .../suites/tracing/knex/mysql2/test.ts | 7 ++++--- .../suites/tracing/knex/pg/test.ts | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts index aebef60c8be5..ec3947f54f4a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/mysql2/test.ts @@ -10,6 +10,7 @@ import { SERVER_ADDRESS, SERVER_PORT, } from '@sentry/conventions/attributes'; +import { DB } from '@sentry/conventions/op'; import { describe, expect } from 'vitest'; import { createEsmAndCjsTests, describeWithDockerCompose } from '../../../../utils/runner'; @@ -29,7 +30,7 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [DB_USER]: { type: 'string', value: 'root' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, [SERVER_PORT]: { type: 'integer', value: 3307 }, [DB_QUERY_TEXT]: { @@ -49,7 +50,7 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [DB_USER]: { type: 'string', value: 'root' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, [SERVER_PORT]: { type: 'integer', value: 3307 }, [DB_QUERY_TEXT]: { type: 'string', value: 'insert into `User` (`email`, `name`) values (?, ?)' }, @@ -69,7 +70,7 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di [DB_QUERY_TEXT]: { type: 'string', value: 'select * from `User`' }, [DB_USER]: { type: 'string', value: 'root' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [DB_QUERY_SUMMARY]: { type: 'string', value: 'select `User`' }, }), status: 'ok', diff --git a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts index f2fdf76b8dee..ae9ea260eab4 100644 --- a/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/knex/pg/test.ts @@ -9,6 +9,7 @@ import { SERVER_ADDRESS, SERVER_PORT, } from '@sentry/conventions/attributes'; +import { DB } from '@sentry/conventions/op'; import { describe, expect } from 'vitest'; import { createEsmAndCjsTests, describeWithDockerCompose } from '../../../../utils/runner'; @@ -27,7 +28,7 @@ describe('knex auto instrumentation', () => { [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, [SERVER_PORT]: { type: 'integer', value: 5445 }, [DB_QUERY_TEXT]: { @@ -46,7 +47,7 @@ describe('knex auto instrumentation', () => { [DB_SYSTEM_NAME]: { type: 'string', value: 'postgresql' }, [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [SERVER_ADDRESS]: { type: 'string', value: 'localhost' }, [SERVER_PORT]: { type: 'integer', value: 5445 }, [DB_QUERY_TEXT]: { type: 'string', value: 'insert into "User" ("email", "name") values (?, ?)' }, @@ -66,7 +67,7 @@ describe('knex auto instrumentation', () => { [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [DB_QUERY_TEXT]: { type: 'string', value: 'select * from "User"' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [DB_QUERY_SUMMARY]: { type: 'string', value: 'select "User"' }, }), status: 'ok', @@ -82,7 +83,7 @@ describe('knex auto instrumentation', () => { [DB_NAMESPACE]: { type: 'string', value: 'tests' }, [DB_QUERY_TEXT]: { type: 'string', value: 'select * from "DoesNotExist"' }, [SENTRY_ORIGIN]: { type: 'string', value: ORIGIN }, - [SENTRY_OP]: { type: 'string', value: 'db' }, + [SENTRY_OP]: { type: 'string', value: DB }, [DB_QUERY_SUMMARY]: { type: 'string', value: 'select "DoesNotExist"' }, }), status: 'error',