Skip to content

Commit 27487da

Browse files
authored
Merge branch 'develop' into rolaabuhasna/js-991-emit-schema-span-property-for-vercel-ai
2 parents 1a500df + 632f0b9 commit 27487da

File tree

42 files changed

+674
-1393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+674
-1393
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ body:
5151
- '@sentry/nestjs'
5252
- '@sentry/nextjs'
5353
- '@sentry/nuxt'
54-
- '@sentry/pino-transport'
5554
- '@sentry/react'
5655
- '@sentry/react-router'
5756
- '@sentry/remix'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fetchButton.addEventListener('click', () => {
2+
// W3C spec example: property values can contain = signs
3+
// See: https://www.w3.org/TR/baggage/#example
4+
fetch('http://sentry-test-site.example/fetch-test', {
5+
headers: {
6+
baggage: 'key1=value1;property1;property2,key2=value2,key3=value3; propertyKey=propertyValue',
7+
},
8+
});
9+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Fetch Baggage Property Values Test</title>
7+
</head>
8+
<body>
9+
<button id="fetchButton">Make Fetch Request</button>
10+
</body>
11+
</html>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { expect } from '@playwright/test';
2+
import { TRACEPARENT_REGEXP } from '@sentry/core';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest(
7+
'preserves baggage property values with equal signs in fetch requests',
8+
async ({ getLocalTestUrl, page }) => {
9+
if (shouldSkipTracingTest()) {
10+
sentryTest.skip();
11+
}
12+
13+
const url = await getLocalTestUrl({ testDir: __dirname });
14+
15+
const requestPromise = page.waitForRequest('http://sentry-test-site.example/fetch-test');
16+
17+
await page.goto(url);
18+
await page.click('#fetchButton');
19+
20+
const request = await requestPromise;
21+
22+
const requestHeaders = request.headers();
23+
24+
expect(requestHeaders).toMatchObject({
25+
'sentry-trace': expect.stringMatching(TRACEPARENT_REGEXP),
26+
});
27+
28+
const baggageHeader = requestHeaders.baggage;
29+
expect(baggageHeader).toBeDefined();
30+
31+
const baggageItems = baggageHeader.split(',').map(item => decodeURIComponent(item.trim()));
32+
33+
// Verify property values with = signs are preserved
34+
expect(baggageItems).toContainEqual(expect.stringContaining('key1=value1;property1;property2'));
35+
expect(baggageItems).toContainEqual(expect.stringContaining('key2=value2'));
36+
expect(baggageItems).toContainEqual(expect.stringContaining('key3=value3; propertyKey=propertyValue'));
37+
38+
// Verify Sentry baggage is also present
39+
expect(baggageHeader).toMatch(/sentry-/);
40+
},
41+
);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const xhr = new XMLHttpRequest();
2+
3+
xhr.open('GET', 'http://sentry-test-site.example/1');
4+
// W3C spec example: property values can contain = signs
5+
// See: https://www.w3.org/TR/baggage/#example
6+
xhr.setRequestHeader('baggage', 'key1=value1;property1;property2,key2=value2,key3=value3; propertyKey=propertyValue');
7+
8+
xhr.send();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { expect } from '@playwright/test';
2+
import { TRACEPARENT_REGEXP } from '@sentry/core';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest('preserves baggage property values with equal signs in XHR requests', async ({ getLocalTestUrl, page }) => {
7+
if (shouldSkipTracingTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const url = await getLocalTestUrl({ testDir: __dirname });
12+
13+
const requestPromise = page.waitForRequest('http://sentry-test-site.example/1');
14+
15+
await page.goto(url);
16+
17+
const request = await requestPromise;
18+
19+
const requestHeaders = request.headers();
20+
21+
expect(requestHeaders).toMatchObject({
22+
'sentry-trace': expect.stringMatching(TRACEPARENT_REGEXP),
23+
});
24+
25+
const baggageHeader = requestHeaders.baggage;
26+
expect(baggageHeader).toBeDefined();
27+
const baggageItems = baggageHeader.split(',').map(item => decodeURIComponent(item.trim()));
28+
29+
// Verify property values with = signs are preserved
30+
expect(baggageItems).toContainEqual(expect.stringContaining('key1=value1;property1;property2'));
31+
expect(baggageItems).toContainEqual(expect.stringContaining('key2=value2'));
32+
expect(baggageItems).toContainEqual(expect.stringContaining('key3=value3; propertyKey=propertyValue'));
33+
34+
// Verify Sentry baggage is also present
35+
expect(baggageHeader).toMatch(/sentry-/);
36+
});

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const DEPENDENTS: Dependent[] = [
5353
'NODE_VERSION',
5454
'childProcessIntegration',
5555
'systemErrorIntegration',
56+
'pinoIntegration',
5657
],
5758
},
5859
{

dev-packages/e2e-tests/verdaccio-config/config.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,6 @@ packages:
122122
unpublish: $all
123123
# proxy: npmjs # Don't proxy for E2E tests!
124124

125-
'@sentry/pino-transport':
126-
access: $all
127-
publish: $all
128-
unpublish: $all
129-
# proxy: npmjs # Don't proxy for E2E tests!
130-
131125
'@sentry/profiling-node':
132126
access: $all
133127
publish: $all

dev-packages/node-integration-tests/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
"node-schedule": "^2.1.1",
6767
"openai": "5.18.1",
6868
"pg": "8.16.0",
69+
"pino": "9.9.4",
70+
"pino-next": "npm:pino@^9.12.0",
6971
"postgres": "^3.4.7",
7072
"prisma": "6.15.0",
7173
"proxy": "^2.1.1",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport, startExpressServerAndSendPortToRunner } from '@sentry-internal/node-integration-tests';
3+
4+
export type TestAPIResponse = { test_data: { host: string; 'sentry-trace': string; baggage: string } };
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
release: '1.0',
9+
environment: 'prod',
10+
// disable requests to /express
11+
tracePropagationTargets: [/^(?!.*express).*$/],
12+
tracesSampleRate: 1.0,
13+
transport: loggingTransport,
14+
});
15+
16+
import cors from 'cors';
17+
import express from 'express';
18+
import http from 'http';
19+
20+
const app = express();
21+
22+
app.use(cors());
23+
24+
app.get('/test/express-property-values', (req, res) => {
25+
const incomingBaggage = req.headers.baggage;
26+
27+
// Forward the incoming baggage (which contains property values) to the outgoing request
28+
// This tests that property values with = signs are preserved during parsing and re-serialization
29+
const headers = http.get({ hostname: 'somewhere.not.sentry', headers: { baggage: incomingBaggage } }).getHeaders();
30+
31+
// Responding with the headers outgoing request headers back to the assertions.
32+
res.send({ test_data: headers });
33+
});
34+
35+
Sentry.setupExpressErrorHandler(app);
36+
37+
startExpressServerAndSendPortToRunner(app);

0 commit comments

Comments
 (0)