Skip to content

Commit b0b09f8

Browse files
authored
ref(server-utils): Streamline mysql2 integration (#23331)
Combine into a single folder, remove unused exports, streamline into singular integration.
1 parent dad5b55 commit b0b09f8

5 files changed

Lines changed: 8 additions & 39 deletions

File tree

packages/server-utils/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export * from './exports';
22

33
// Exports using diagnostics channels
4-
export { mysql2Integration } from './mysql2';
54
export { instrumentPrisma, prismaIntegration } from './prisma';
65
export type { PrismaInstrumentationConfig, PrismaOptions } from './prisma';
76
export { bindTracingChannelToSpan } from './tracing-channel';

packages/server-utils/src/integrations/mysql2.ts renamed to packages/server-utils/src/integrations/mysql2/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import {
88
startInactiveSpan,
99
waitForTracingChannelBinding,
1010
} from '@sentry/core';
11-
import { subscribeMysql2DiagnosticChannels } from '../mysql2/mysql2-dc-subscriber';
12-
import type { ChannelName } from '../orchestrion/channels';
13-
import { CHANNELS } from '../orchestrion/channels';
14-
import { bindTracingChannelToSpan } from '../tracing-channel';
15-
import { mysql2ModuleNames } from '../orchestrion/config/mysql2';
16-
import { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';
11+
import { subscribeMysql2DiagnosticChannels } from './mysql2-dc-subscriber';
12+
import type { ChannelName } from '../../orchestrion/channels';
13+
import { CHANNELS } from '../../orchestrion/channels';
14+
import { bindTracingChannelToSpan } from '../../tracing-channel';
15+
import { mysql2ModuleNames } from '../../orchestrion/config/mysql2';
16+
import { invokeOrchestrionInstrumentation } from '../../orchestrion/instrumentation';
1717
import {
1818
DB_NAME,
1919
DB_STATEMENT,

packages/server-utils/src/mysql2/mysql2-dc-subscriber.ts renamed to packages/server-utils/src/integrations/mysql2/mysql2-dc-subscriber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
1414
startInactiveSpan,
1515
} from '@sentry/core';
16-
import { bindTracingChannelToSpan } from '../tracing-channel';
16+
import { bindTracingChannelToSpan } from '../../tracing-channel';
1717

1818
// Channel names published by mysql2 >= 3.20.0 (see mysql2 `lib/tracing.js`).
1919
// Hardcoded so the subscriber does not have to import mysql2 — the channels

packages/server-utils/src/mysql2/index.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/server-utils/test/mysql2/mysql2-dc-subscriber.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
MYSQL2_DC_CHANNEL_QUERY,
2626
type MySQL2TracingChannelFactory,
2727
subscribeMysql2DiagnosticChannels,
28-
} from '../../src/mysql2/mysql2-dc-subscriber';
28+
} from '../../src/integrations/mysql2/mysql2-dc-subscriber';
2929

3030
interface TestStore {
3131
scope: Scope;

0 commit comments

Comments
 (0)