Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
},
{
data: {
'sentry.origin': 'auto.http.otel.connect',
'sentry.origin': 'auto.http.connect',
'sentry.op': 'request_handler.connect',
'http.route': '/test-transaction',
'connect.type': 'request_handler',
Expand All @@ -86,7 +86,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
status: 'ok',
timestamp: expect.any(Number),
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
origin: 'auto.http.otel.connect',
origin: 'auto.http.connect',
},
],
transaction: 'GET /test-transaction',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ describe('connect auto-instrumentation', () => {
'connect.name': '/',
'connect.type': 'request_handler',
'http.route': '/',
'sentry.origin': 'auto.http.otel.connect',
'sentry.origin': 'auto.http.connect',
'sentry.op': 'request_handler.connect',
}),
description: '/',
origin: 'auto.http.otel.connect',
origin: 'auto.http.connect',
op: 'request_handler.connect',
status: 'ok',
}),
Expand All @@ -36,32 +36,26 @@ describe('connect auto-instrumentation', () => {
},
};

createEsmAndCjsTests(
__dirname,
'scenario.mjs',
'instrument.mjs',
(createTestRunner, test) => {
test('should auto-instrument `connect` package.', async () => {
const runner = createTestRunner().expect({ transaction: EXPECTED_TRANSACTION }).start();
runner.makeRequest('get', '/');
await runner.completed();
});
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createTestRunner, test) => {
test('should auto-instrument `connect` package.', async () => {
const runner = createTestRunner().expect({ transaction: EXPECTED_TRANSACTION }).start();
runner.makeRequest('get', '/');
await runner.completed();
});

test('should capture errors in `connect` middleware.', async () => {
const runner = createTestRunner().ignore('transaction').expect({ event: EXPECTED_EVENT }).start();
runner.makeRequest('get', '/error');
await runner.completed();
});
test('should capture errors in `connect` middleware.', async () => {
const runner = createTestRunner().ignore('transaction').expect({ event: EXPECTED_EVENT }).start();
runner.makeRequest('get', '/error');
await runner.completed();
});

test('should report errored transactions.', async () => {
const runner = createTestRunner()
.ignore('event')
.expect({ transaction: { transaction: 'GET /error' } })
.start();
runner.makeRequest('get', '/error');
await runner.completed();
});
},
{ failsOnEsm: true },
);
test('should report errored transactions.', async () => {
const runner = createTestRunner()
.ignore('event')
.expect({ transaction: { transaction: 'GET /error' } })
.start();
runner.makeRequest('get', '/error');
await runner.completed();
});
});
});
5 changes: 5 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export type {
ExpressMiddleware,
ExpressErrorMiddleware,
} from './integrations/express/types';
export { patchConnectModule, setupConnectErrorHandler } from './integrations/connect/index';
export type { ConnectIntegrationOptions, ConnectModule } from './integrations/connect/index';
export { dedupeIntegration } from './integrations/dedupe';
export { extraErrorDataIntegration } from './integrations/extraerrordata';
export { rewriteFramesIntegration } from './integrations/rewriteframes';
Expand All @@ -152,6 +154,9 @@ export { growthbookIntegration } from './integrations/featureFlags';
export { conversationIdIntegration } from './integrations/conversationId';
export { patchHttpModuleClient } from './integrations/http/client-patch';
export { getHttpClientSubscriptions } from './integrations/http/client-subscriptions';
export { getHttpServerSubscriptions } from './integrations/http/server-subscription';
export { recordRequestSession } from './integrations/http/record-request-session';
export { getHttpServerSpanSubscriptions, isStaticAssetRequest } from './integrations/http/server-span-subscription';
export { addOutgoingRequestBreadcrumb } from './integrations/http/add-outgoing-request-breadcrumb';
export {
getRequestUrl,
Expand Down
Loading
Loading