Skip to content
Merged
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
@@ -0,0 +1,9 @@
import * as Sentry from '@sentry/node';

Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.E2E_TEST_DSN,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1,
tracePropagationTargets: ['http://localhost:3030', '/external-allowed'],
});
12 changes: 4 additions & 8 deletions dev-packages/e2e-tests/test-applications/node-nestjs/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Import this first
import './instrument';

// Import other modules
import { BaseExceptionFilter, HttpAdapterHost, NestFactory } from '@nestjs/core';
import * as Sentry from '@sentry/node';
import { AppModule1, AppModule2 } from './app.module';
Expand All @@ -6,14 +10,6 @@ const app1Port = 3030;
const app2Port = 3040;

async function bootstrap() {
Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.E2E_TEST_DSN,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1,
tracePropagationTargets: ['http://localhost:3030', '/external-allowed'],
});

const app1 = await NestFactory.create(AppModule1);

const { httpAdapter } = app1.get(HttpAdapterHost);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ test('Sends an API route transaction', async ({ baseURL }) => {
trace_id: expect.any(String),
origin: 'manual',
},
{
span_id: expect.any(String),
trace_id: expect.any(String),
data: {
'sentry.origin': 'manual',
component: '@nestjs/core',
'nestjs.version': expect.any(String),
'nestjs.type': 'handler',
'nestjs.callback': 'testTransaction',
'otel.kind': 'INTERNAL',
},
description: 'testTransaction',
parent_span_id: expect.any(String),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
status: 'ok',
origin: 'manual',
},
]),
transaction: 'GET /test-transaction',
type: 'transaction',
Expand Down