Skip to content

Commit 06fd1d8

Browse files
authored
Merge branch 'develop' into nh/openai-embeddings-api
2 parents b3ae30b + 610ae69 commit 06fd1d8

File tree

97 files changed

+3688
-424
lines changed

Some content is hidden

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

97 files changed

+3688
-424
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ body:
136136
id: additional
137137
attributes:
138138
label: Additional Context
139-
description:
140-
Add any other context here. Please keep the pre-filled text, which helps us manage issue prioritization.
141-
value: |-
142-
<sub>Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.</sub>
139+
description: Add any other context here.
143140
validations:
144141
required: false
145-
- type: markdown
142+
- type: dropdown
146143
attributes:
147-
value: |-
148-
## Thanks 🙏
144+
label: 'Priority'
145+
description: Please keep the pre-filled option, which helps us manage issue prioritization.
146+
default: 0
147+
options:
148+
- <sub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1`
149+
or `me too`, to help us triage it.</sub>

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ body:
2727
id: additional
2828
attributes:
2929
label: Additional Context
30-
description:
31-
Add any other context here. Please keep the pre-filled text, which helps us manage feature prioritization.
32-
value: |-
33-
<sub>Tip: React with 👍 to help prioritize this improvement. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.</sub>
30+
description: Add any other context here.
3431
validations:
3532
required: false
36-
- type: markdown
33+
- type: dropdown
3734
attributes:
38-
value: |-
39-
## Thanks 🙏
40-
Check our [triage docs](https://open.sentry.io/triage/) for what to expect next.
35+
label: 'Priority'
36+
description: Please keep the pre-filled option, which helps us manage issue prioritization.
37+
default: 0
38+
options:
39+
- <sub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1`
40+
or `me too`, to help us triage it.</sub>

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = [
3838
path: 'packages/browser/build/npm/esm/prod/index.js',
3939
import: createImport('init', 'browserTracingIntegration'),
4040
gzip: true,
41-
limit: '41.3 KB',
41+
limit: '41.38 KB',
4242
},
4343
{
4444
name: '@sentry/browser (incl. Tracing, Profiling)',
@@ -127,7 +127,7 @@ module.exports = [
127127
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
128128
ignore: ['react/jsx-runtime'],
129129
gzip: true,
130-
limit: '43.3 KB',
130+
limit: '43.33 KB',
131131
},
132132
// Vue SDK (ESM)
133133
{
@@ -142,7 +142,7 @@ module.exports = [
142142
path: 'packages/vue/build/esm/index.js',
143143
import: createImport('init', 'browserTracingIntegration'),
144144
gzip: true,
145-
limit: '43.1 KB',
145+
limit: '43.2 KB',
146146
},
147147
// Svelte SDK (ESM)
148148
{

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
6+
57
- fix(node): Fix Spotlight configuration precedence to match specification (#18195)
68

79
## 10.25.0
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://public@dsn.ingest.sentry.io/1337',
7+
release: '1.0.0',
8+
environment: 'test',
9+
integrations: integrations => {
10+
return integrations.filter(integration => integration.name !== 'BrowserSession');
11+
},
12+
beforeSendMetric: metric => {
13+
if (metric.name === 'test.counter') {
14+
return {
15+
...metric,
16+
attributes: {
17+
...metric.attributes,
18+
modified: 'by-beforeSendMetric',
19+
original: undefined,
20+
},
21+
};
22+
}
23+
return metric;
24+
},
25+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Store captured metrics from the afterCaptureMetric event
2+
window.capturedMetrics = [];
3+
4+
const client = Sentry.getClient();
5+
6+
client.on('afterCaptureMetric', metric => {
7+
window.capturedMetrics.push(metric);
8+
});
9+
10+
// Capture metrics - these should be processed by beforeSendMetric
11+
Sentry.metrics.count('test.counter', 1, { attributes: { endpoint: '/api/test', original: 'value' } });
12+
Sentry.metrics.gauge('test.gauge', 42, { unit: 'millisecond', attributes: { server: 'test-1' } });
13+
14+
Sentry.flush();
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { expect } from '@playwright/test';
2+
import { sentryTest } from '../../../../utils/fixtures';
3+
4+
sentryTest(
5+
'should emit afterCaptureMetric event with processed metric from beforeSendMetric',
6+
async ({ getLocalTestUrl, page }) => {
7+
const bundle = process.env.PW_BUNDLE || '';
8+
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
9+
sentryTest.skip();
10+
}
11+
12+
const url = await getLocalTestUrl({ testDir: __dirname });
13+
await page.goto(url);
14+
15+
await page.waitForFunction(() => {
16+
return (window as any).capturedMetrics.length >= 2;
17+
});
18+
19+
const capturedMetrics = await page.evaluate(() => {
20+
return (window as any).capturedMetrics;
21+
});
22+
23+
expect(capturedMetrics).toHaveLength(2);
24+
25+
// Verify the counter metric was modified by beforeSendMetric
26+
expect(capturedMetrics[0]).toMatchObject({
27+
name: 'test.counter',
28+
type: 'counter',
29+
value: 1,
30+
attributes: {
31+
endpoint: '/api/test',
32+
modified: 'by-beforeSendMetric',
33+
'sentry.release': '1.0.0',
34+
'sentry.environment': 'test',
35+
'sentry.sdk.name': 'sentry.javascript.browser',
36+
},
37+
});
38+
39+
// Verify the 'original' attribute was removed by beforeSendMetric
40+
expect(capturedMetrics[0].attributes.original).toBeUndefined();
41+
42+
// Verify the gauge metric was not modified (no beforeSendMetric processing)
43+
expect(capturedMetrics[1]).toMatchObject({
44+
name: 'test.gauge',
45+
type: 'gauge',
46+
unit: 'millisecond',
47+
value: 42,
48+
attributes: {
49+
server: 'test-1',
50+
'sentry.release': '1.0.0',
51+
'sentry.environment': 'test',
52+
'sentry.sdk.name': 'sentry.javascript.browser',
53+
},
54+
});
55+
56+
expect(capturedMetrics[0].attributes['sentry.sdk.version']).toBeDefined();
57+
expect(capturedMetrics[1].attributes['sentry.sdk.version']).toBeDefined();
58+
},
59+
);
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { expect, test } from '@playwright/test';
2+
import { waitForTransaction } from '@sentry-internal/test-utils';
3+
4+
test('Sends a transaction for a request to app router with URL', async ({ page }) => {
5+
const serverComponentTransactionPromise = waitForTransaction('nextjs-13', transactionEvent => {
6+
return (
7+
transactionEvent?.transaction === 'GET /parameterized/[one]/beep/[two]' &&
8+
transactionEvent.contexts?.trace?.data?.['http.target']?.startsWith('/parameterized/1337/beep/42')
9+
);
10+
});
11+
12+
await page.goto('/parameterized/1337/beep/42');
13+
14+
const transactionEvent = await serverComponentTransactionPromise;
15+
16+
expect(transactionEvent.contexts?.trace).toEqual({
17+
data: expect.objectContaining({
18+
'sentry.op': 'http.server',
19+
'sentry.origin': 'auto',
20+
'sentry.sample_rate': 1,
21+
'sentry.source': 'route',
22+
'http.method': 'GET',
23+
'http.response.status_code': 200,
24+
'http.route': '/parameterized/[one]/beep/[two]',
25+
'http.status_code': 200,
26+
'http.target': '/parameterized/1337/beep/42',
27+
'otel.kind': 'SERVER',
28+
'next.route': '/parameterized/[one]/beep/[two]',
29+
}),
30+
op: 'http.server',
31+
origin: 'auto',
32+
span_id: expect.stringMatching(/[a-f0-9]{16}/),
33+
status: 'ok',
34+
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
35+
});
36+
37+
expect(transactionEvent.request).toMatchObject({
38+
url: expect.stringContaining('/parameterized/1337/beep/42'),
39+
});
40+
41+
// The transaction should not contain any spans with the same name as the transaction
42+
// e.g. "GET /parameterized/[one]/beep/[two]"
43+
expect(
44+
transactionEvent.spans?.filter(span => {
45+
return span.description === transactionEvent.transaction;
46+
}),
47+
).toHaveLength(0);
48+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export const revalidate = 60; // ISR: revalidate every 60 seconds
2+
export const dynamicParams = true; // Allow dynamic params beyond generateStaticParams
3+
4+
export async function generateStaticParams(): Promise<Array<{ product: string }>> {
5+
return [{ product: 'laptop' }, { product: 'phone' }, { product: 'tablet' }];
6+
}
7+
8+
export default async function ISRProductPage({ params }: { params: Promise<{ product: string }> }) {
9+
const { product } = await params;
10+
11+
return (
12+
<div>
13+
<h1>ISR Product: {product}</h1>
14+
<div id="isr-product-id">{product}</div>
15+
</div>
16+
);
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const revalidate = 60; // ISR: revalidate every 60 seconds
2+
export const dynamicParams = true;
3+
4+
export async function generateStaticParams(): Promise<never[]> {
5+
return [];
6+
}
7+
8+
export default function ISRStaticPage() {
9+
return (
10+
<div>
11+
<h1>ISR Static Page</h1>
12+
<div id="isr-static-marker">static-isr</div>
13+
</div>
14+
);
15+
}

0 commit comments

Comments
 (0)