Skip to content

Commit 62cd1ff

Browse files
committed
sentry.origin
1 parent 1fddf59 commit 62cd1ff

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-measure-spans-domexception-details/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sentryTest(
2525
expect(restrictedMeasure).toBeDefined();
2626
expect(restrictedMeasure?.data).toMatchObject({
2727
'sentry.op': 'measure',
28-
'sentry.origin': 'auto.resource.browser.user_timing',
28+
'sentry.origin': 'auto.browser.user_timing.measure',
2929
});
3030

3131
// Verify no detail attributes were added due to the permission error
@@ -39,15 +39,15 @@ sentryTest(
3939
expect(normalMeasure?.data).toMatchObject({
4040
'sentry.browser.measure.detail': 'this-should-work',
4141
'sentry.op': 'measure',
42-
'sentry.origin': 'auto.resource.browser.user_timing',
42+
'sentry.origin': 'auto.browser.user_timing.measure',
4343
});
4444

4545
// Test 3: Verify the complex detail object is captured correctly
4646
const complexMeasure = measureSpans?.find(span => span.description === 'complex-detail-measure');
4747
expect(complexMeasure).toBeDefined();
4848
expect(complexMeasure?.data).toMatchObject({
4949
'sentry.op': 'measure',
50-
'sentry.origin': 'auto.resource.browser.user_timing',
50+
'sentry.origin': 'auto.browser.user_timing.measure',
5151
// The entire nested object is stringified as a single value
5252
'sentry.browser.measure.detail.nested': JSON.stringify({
5353
array: [1, 2, 3],

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-measure-spans/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
3030
'sentry.browser.measure_happened_before_request': true,
3131
'sentry.browser.measure_start_time': expect.any(Number),
3232
'sentry.op': 'measure',
33-
'sentry.origin': 'auto.resource.browser.user_timing',
33+
'sentry.origin': 'auto.browser.user_timing.measure',
3434
});
3535
});

dev-packages/browser-integration-tests/suites/tracing/user-timing-spans/test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ sentryTest('captures non-ignored mark and measure spans', async ({ getLocalTestU
1414
const spans = await spansPromise;
1515
const userTimingSpans = spans
1616
.filter(span => ['mark', 'measure'].includes(getSpanOp(span) ?? ''))
17-
.map(span => ({ name: span.name, op: getSpanOp(span) }))
17+
.map(span => ({
18+
name: span.name,
19+
op: getSpanOp(span),
20+
origin: span.attributes['sentry.origin']?.value,
21+
}))
1822
.sort((a, b) => a.name.localeCompare(b.name));
1923

2024
expect(userTimingSpans).toEqual([
21-
{ name: 'mark-pass', op: 'mark' },
22-
{ name: 'measure-pass', op: 'measure' },
25+
{ name: 'mark-pass', op: 'mark', origin: 'auto.browser.user_timing.mark' },
26+
{ name: 'measure-pass', op: 'measure', origin: 'auto.browser.user_timing.measure' },
2327
]);
2428
});

packages/browser-utils/src/metrics/userTiming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function _addUserTimingSpan(
114114
const spanEndTimestamp = originalStartTimestamp + duration;
115115

116116
const attributes: SpanAttributes = {
117-
[SENTRY_ORIGIN]: 'auto.resource.browser.user_timing',
117+
[SENTRY_ORIGIN]: `auto.browser.user_timing.${entry.entryType}`,
118118
};
119119

120120
if (spanStartTimestamp !== originalStartTimestamp) {

packages/browser-utils/test/metrics/userTiming.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('_addUserTimingSpan', () => {
163163
'sentry.browser.measure.detail.phase': 'client',
164164
'sentry.browser.measure.detail.counts': '{"components":4}',
165165
'sentry.op': 'measure',
166-
'sentry.origin': 'auto.resource.browser.user_timing',
166+
'sentry.origin': 'auto.browser.user_timing.measure',
167167
});
168168
});
169169

0 commit comments

Comments
 (0)