Skip to content

Commit bbcec87

Browse files
committed
fix tests
1 parent 7f69303 commit bbcec87

File tree

10 files changed

+51
-2
lines changed

10 files changed

+51
-2
lines changed

dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/tests/propagation.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
7575
'http.status_code': 200,
7676
'http.status_text': 'OK',
7777
'http.route': '/test-outgoing-http/:id',
78+
'http.request.header.accept': ['*/*'],
79+
'http.request.header.accept_encoding': ['gzip, deflate'],
80+
'http.request.header.accept_language': ['*'],
81+
'http.request.header.connection': ['keep-alive'],
82+
'http.request.header.host': ['localhost:3030'],
83+
'http.request.header.sec_fetch_mode': ['cors'],
84+
'http.request.header.user_agent': ['node'],
7885
},
7986
op: 'http.server',
8087
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/node-fastify-3/tests/propagation.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
7575
'http.status_code': 200,
7676
'http.status_text': 'OK',
7777
'http.route': '/test-outgoing-http/:id',
78+
'http.request.header.accept': ['*/*'],
79+
'http.request.header.accept_encoding': ['gzip, deflate'],
80+
'http.request.header.accept_language': ['*'],
81+
'http.request.header.connection': ['keep-alive'],
82+
'http.request.header.host': ['localhost:3030'],
83+
'http.request.header.sec_fetch_mode': ['cors'],
84+
'http.request.header.user_agent': ['node'],
7885
},
7986
op: 'http.server',
8087
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/node-fastify-4/tests/propagation.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
7575
'http.status_code': 200,
7676
'http.status_text': 'OK',
7777
'http.route': '/test-outgoing-http/:id',
78+
'http.request.header.accept': ['*/*'],
79+
'http.request.header.accept_encoding': ['gzip, deflate'],
80+
'http.request.header.accept_language': ['*'],
81+
'http.request.header.connection': ['keep-alive'],
82+
'http.request.header.host': ['localhost:3030'],
83+
'http.request.header.sec_fetch_mode': ['cors'],
84+
'http.request.header.user_agent': ['node'],
7885
},
7986
op: 'http.server',
8087
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/node-fastify-5/tests/propagation.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
7575
'http.status_code': 200,
7676
'http.status_text': 'OK',
7777
'http.route': '/test-outgoing-http/:id',
78+
'http.request.header.accept': ['*/*'],
79+
'http.request.header.accept_encoding': ['gzip, deflate'],
80+
'http.request.header.accept_language': ['*'],
81+
'http.request.header.connection': ['keep-alive'],
82+
'http.request.header.host': ['localhost:3030'],
83+
'http.request.header.sec_fetch_mode': ['cors'],
84+
'http.request.header.user_agent': ['node'],
7885
}),
7986
op: 'http.server',
8087
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/node-hapi/tests/transactions.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ test('Sends successful transaction', async ({ baseURL }) => {
3737
'http.status_code': 200,
3838
'http.status_text': 'OK',
3939
'http.route': '/test-success',
40+
'http.request.header.accept': ['*/*'],
41+
'http.request.header.accept_encoding': ['gzip, deflate'],
42+
'http.request.header.accept_language': ['*'],
43+
'http.request.header.connection': ['keep-alive'],
44+
'http.request.header.host': ['localhost:3030'],
45+
'http.request.header.sec_fetch_mode': ['cors'],
46+
'http.request.header.user_agent': ['node'],
4047
},
4148
op: 'http.server',
4249
span_id: expect.stringMatching(/[a-f0-9]{16}/),

dev-packages/e2e-tests/test-applications/node-otel-custom-sampler/tests/sampling.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => {
3636
'http.status_code': 200,
3737
'http.status_text': 'OK',
3838
'http.route': '/task',
39+
'http.request.header.accept': ['*/*'],
40+
'http.request.header.accept_encoding': ['gzip, deflate'],
41+
'http.request.header.accept_language': ['*'],
42+
'http.request.header.connection': ['keep-alive'],
43+
'http.request.header.host': ['localhost:3030'],
44+
'http.request.header.sec_fetch_mode': ['cors'],
45+
'http.request.header.user_agent': ['node'],
3946
},
4047
origin: 'auto.http.otel.http',
4148
op: 'http.server',

packages/aws-serverless/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export {
4242
close,
4343
getSentryRelease,
4444
createGetModuleFromFilename,
45+
httpHeadersToSpanAttributes,
46+
winterCGHeadersToDict,
4547
// eslint-disable-next-line deprecation/deprecation
4648
anrIntegration,
4749
// eslint-disable-next-line deprecation/deprecation

packages/bun/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export {
6262
close,
6363
getSentryRelease,
6464
createGetModuleFromFilename,
65+
httpHeadersToSpanAttributes,
66+
winterCGHeadersToDict,
6567
// eslint-disable-next-line deprecation/deprecation
6668
anrIntegration,
6769
// eslint-disable-next-line deprecation/deprecation

packages/core/test/lib/utils/request.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,14 @@ describe('request utils', () => {
541541

542542
it('handles multiple values for the same header', () => {
543543
const headers = {
544-
Cookie: ['session=abc123', 'preferences=dark-mode'],
544+
'x-random-header': ['test=abc123', 'preferences=dark-mode', 'number=three'],
545545
Accept: ['application/json', 'text/html'],
546546
};
547547

548548
const result = httpHeadersToSpanAttributes(headers);
549549

550550
expect(result).toEqual({
551-
'http.request.header.cookie': ['session=abc123', 'preferences=dark-mode'],
551+
'http.request.header.x_random_header': ['test=abc123', 'preferences=dark-mode', 'number=three'],
552552
'http.request.header.accept': ['application/json', 'text/html'],
553553
});
554554
});
@@ -629,6 +629,7 @@ describe('request utils', () => {
629629
expect(result).toEqual({
630630
'http.request.header.content_type': ['application/json'],
631631
'http.request.header.user_agent': ['test-agent'],
632+
'http.request.header.authorization': ['Bearer secret-token'],
632633
'http.request.header.cookie': ['session=abc123'],
633634
'http.request.header.x_api_key': ['api-key-123'],
634635
});

packages/google-cloud-serverless/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export {
4242
close,
4343
getSentryRelease,
4444
createGetModuleFromFilename,
45+
httpHeadersToSpanAttributes,
46+
winterCGHeadersToDict,
4547
// eslint-disable-next-line deprecation/deprecation
4648
anrIntegration,
4749
// eslint-disable-next-line deprecation/deprecation

0 commit comments

Comments
 (0)