File tree Expand file tree Collapse file tree 14 files changed +289
-6
lines changed
dev-packages/node-integration-tests
packages/opentelemetry/src Expand file tree Collapse file tree 14 files changed +289
-6
lines changed Original file line number Diff line number Diff line change
1
+ import { loggingTransport } from '@sentry-internal/node-integration-tests' ;
2
+ import * as Sentry from '@sentry/node' ;
3
+
4
+ Sentry . init ( {
5
+ dsn :
'https://[email protected] /1337' ,
6
+ release : '1.0' ,
7
+ tracePropagationTargets : [ / \/ v 0 / , 'v1' ] ,
8
+ tracesSampleRate : 0 ,
9
+ integrations : [ ] ,
10
+ transport : loggingTransport ,
11
+ } ) ;
12
+
13
+ Sentry . startSpan ( { name : 'test span' } , ( ) => {
14
+ Sentry . captureException ( new Error ( 'foo' ) ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { createRunner } from '../../../../utils/runner' ;
2
+
3
+ test ( 'envelope header for error event during active unsampled span is correct' , done => {
4
+ createRunner ( __dirname , 'scenario.ts' )
5
+ . ignore ( 'session' , 'sessions' , 'transaction' )
6
+ . expectHeader ( {
7
+ event : {
8
+ trace : {
9
+ trace_id : expect . any ( String ) ,
10
+ public_key : 'public' ,
11
+ environment : 'production' ,
12
+ release : '1.0' ,
13
+ sampled : 'false' ,
14
+ } ,
15
+ } ,
16
+ } )
17
+ . start ( done ) ;
18
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { loggingTransport } from '@sentry-internal/node-integration-tests' ;
2
+ import * as Sentry from '@sentry/node' ;
3
+
4
+ Sentry . init ( {
5
+ dsn :
'https://[email protected] /1337' ,
6
+ release : '1.0' ,
7
+ tracePropagationTargets : [ / \/ v 0 / , 'v1' ] ,
8
+ tracesSampleRate : 1 ,
9
+ integrations : [ ] ,
10
+ transport : loggingTransport ,
11
+ } ) ;
12
+
13
+ Sentry . startSpan ( { name : 'test span' } , ( ) => {
14
+ Sentry . captureException ( new Error ( 'foo' ) ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { createRunner } from '../../../../utils/runner' ;
2
+
3
+ test ( 'envelope header for error event during active span is correct' , done => {
4
+ createRunner ( __dirname , 'scenario.ts' )
5
+ . ignore ( 'session' , 'sessions' , 'transaction' )
6
+ . expectHeader ( {
7
+ event : {
8
+ trace : {
9
+ trace_id : expect . any ( String ) ,
10
+ public_key : 'public' ,
11
+ environment : 'production' ,
12
+ release : '1.0' ,
13
+ sample_rate : '1' ,
14
+ sampled : 'true' ,
15
+ transaction : 'test span' ,
16
+ } ,
17
+ } ,
18
+ } )
19
+ . start ( done ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { loggingTransport } from '@sentry-internal/node-integration-tests' ;
2
+ import * as Sentry from '@sentry/node' ;
3
+
4
+ Sentry . init ( {
5
+ dsn :
'https://[email protected] /1337' ,
6
+ release : '1.0' ,
7
+ tracePropagationTargets : [ / \/ v 0 / , 'v1' ] ,
8
+ tracesSampleRate : 0 ,
9
+ integrations : [ ] ,
10
+ transport : loggingTransport ,
11
+ } ) ;
12
+
13
+ Sentry . captureException ( new Error ( 'foo' ) ) ;
Original file line number Diff line number Diff line change
1
+ import { createRunner } from '../../../../utils/runner' ;
2
+
3
+ test ( 'envelope header for error events is correct' , done => {
4
+ createRunner ( __dirname , 'scenario.ts' )
5
+ . ignore ( 'session' , 'sessions' )
6
+ . expectHeader ( {
7
+ event : {
8
+ trace : {
9
+ trace_id : expect . any ( String ) ,
10
+ environment : 'production' ,
11
+ public_key : 'public' ,
12
+ release : '1.0' ,
13
+ } ,
14
+ } ,
15
+ } )
16
+ . start ( done ) ;
17
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { loggingTransport } from '@sentry-internal/node-integration-tests' ;
2
+ import * as Sentry from '@sentry/node' ;
3
+
4
+ Sentry . init ( {
5
+ dsn :
'https://[email protected] /1337' ,
6
+ release : '1.0' ,
7
+ tracePropagationTargets : [ / \/ v 0 / , 'v1' ] ,
8
+ tracesSampleRate : 1 ,
9
+ integrations : [ ] ,
10
+ transport : loggingTransport ,
11
+ } ) ;
12
+
13
+ Sentry . startSpan (
14
+ {
15
+ name : 'GET /route' ,
16
+ attributes : {
17
+ 'http.method' : 'GET' ,
18
+ 'http.route' : '/route' ,
19
+ [ Sentry . SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'http.server' ,
20
+ [ Sentry . SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'route' ,
21
+ } ,
22
+ } ,
23
+ ( ) => {
24
+ // noop
25
+ } ,
26
+ ) ;
Original file line number Diff line number Diff line change
1
+ import { createRunner } from '../../../../utils/runner' ;
2
+
3
+ test ( 'envelope header for transaction event of route correct' , done => {
4
+ createRunner ( __dirname , 'scenario.ts' )
5
+ . ignore ( 'session' , 'sessions' )
6
+ . expectHeader ( {
7
+ transaction : {
8
+ trace : {
9
+ trace_id : expect . any ( String ) ,
10
+ public_key : 'public' ,
11
+ transaction : 'GET /route' ,
12
+ environment : 'production' ,
13
+ release : '1.0' ,
14
+ sample_rate : '1' ,
15
+ sampled : 'true' ,
16
+ } ,
17
+ } ,
18
+ } )
19
+ . start ( done ) ;
20
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { loggingTransport } from '@sentry-internal/node-integration-tests' ;
2
+ import * as Sentry from '@sentry/node' ;
3
+
4
+ Sentry . init ( {
5
+ dsn :
'https://[email protected] /1337' ,
6
+ release : '1.0' ,
7
+ tracePropagationTargets : [ / \/ v 0 / , 'v1' ] ,
8
+ tracesSampleRate : 1 ,
9
+ integrations : [ ] ,
10
+ transport : loggingTransport ,
11
+ } ) ;
12
+
13
+ Sentry . startSpan (
14
+ {
15
+ name : 'GET /route/1' ,
16
+ attributes : {
17
+ 'http.method' : 'GET' ,
18
+ 'http.route' : '/route' ,
19
+ [ Sentry . SEMANTIC_ATTRIBUTE_SENTRY_OP ] : 'http.server' ,
20
+ [ Sentry . SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'url' ,
21
+ } ,
22
+ } ,
23
+ ( ) => {
24
+ // noop
25
+ } ,
26
+ ) ;
Original file line number Diff line number Diff line change
1
+ import { createRunner } from '../../../../utils/runner' ;
2
+
3
+ test ( 'envelope header for transaction event with source=url correct' , done => {
4
+ createRunner ( __dirname , 'scenario.ts' )
5
+ . ignore ( 'session' , 'sessions' )
6
+ . expectHeader ( {
7
+ transaction : {
8
+ trace : {
9
+ trace_id : expect . any ( String ) ,
10
+ public_key : 'public' ,
11
+ environment : 'production' ,
12
+ release : '1.0' ,
13
+ sample_rate : '1' ,
14
+ sampled : 'true' ,
15
+ } ,
16
+ } ,
17
+ } )
18
+ . start ( done ) ;
19
+ } ) ;
You can’t perform that action at this time.
0 commit comments