Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .cursor/BUGBOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Unless explicitly noted (e.g. in the `Testing Conventions` section), only flag t
- `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` (`'sentry.origin'`) with a proper span origin
- a proper origin must only contain [a-z], [A-Z], [0-9], `_` and `.` characters.
- flag any non-conforming origin values as invalid and link to the trace origin specification (https://develop.sentry.dev/sdk/telemetry/traces/trace-origin/)
- `SEMANTIC_ATTRIBUTE_SENTRY_OP` (`'sentry.op'`) with a proper span op
- `SENTRY_OP` (`'sentry.op'`) with a proper span op
- Span ops should be lower case only, and use snake_case. The `.` character is used to delimit op parts.
- flag any non-conforming op values as invalid and link to the span op specification (https://develop.sentry.dev/sdk/telemetry/traces/span-operations/)
- When calling `captureException`, always make sure that the `mechanism` is set:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -53,7 +54,7 @@ sentryTest('should update spans for GraphQL fetch requests', async ({ getLocalTe
'url.full': 'http://sentry-test.io/foo',
url: 'http://sentry-test.io/foo',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
[SENTRY_OP]: 'http.client',
'sentry.origin': 'auto.http.browser',
'graphql.document': query,
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -47,7 +48,7 @@ sentryTest('should update spans for GraphQL persisted query fetch requests', asy
'url.full': 'http://sentry-test.io/graphql',
url: 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
[SENTRY_OP]: 'http.client',
'sentry.origin': 'auto.http.browser',
'graphql.persisted_query.hash.sha256': 'ecf4edb46db40b5132295c0291d62fb65d6759a9eedfa4d5d612dd5ec54a6b38',
'graphql.persisted_query.version': 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -47,7 +48,7 @@ sentryTest('should update spans for GraphQL persisted query XHR requests', async
'url.full': 'http://sentry-test.io/graphql',
url: 'http://sentry-test.io/graphql',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
[SENTRY_OP]: 'http.client',
'sentry.origin': 'auto.http.browser',
'graphql.persisted_query.hash.sha256': 'ecf4edb46db40b5132295c0291d62fb65d6759a9eedfa4d5d612dd5ec54a6b38',
'graphql.persisted_query.version': 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -53,7 +54,7 @@ sentryTest('should update spans for GraphQL XHR requests', async ({ getLocalTest
'url.full': 'http://sentry-test.io/foo',
url: 'http://sentry-test.io/foo',
'server.address': 'sentry-test.io',
'sentry.op': 'http.client',
[SENTRY_OP]: 'http.client',
'sentry.origin': 'auto.http.browser',
'graphql.document': query,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import type { Page } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/core';
Expand Down Expand Up @@ -94,7 +95,7 @@ sentryTest('should capture Supabase authentication spans', async ({ getLocalTest
trace_id: eventData.contexts?.trace?.trace_id,
status: 'ok',
data: expect.objectContaining({
'sentry.op': 'db',
[SENTRY_OP]: 'db',
'sentry.origin': 'auto.db.supabase',
'db.operation': 'auth.signInWithPassword',
'db.system': 'postgresql',
Expand All @@ -111,7 +112,7 @@ sentryTest('should capture Supabase authentication spans', async ({ getLocalTest
trace_id: eventData.contexts?.trace?.trace_id,
status: 'ok',
data: expect.objectContaining({
'sentry.op': 'db',
[SENTRY_OP]: 'db',
'sentry.origin': 'auto.db.supabase',
'db.operation': 'auth.signOut',
'db.system': 'postgresql',
Expand Down Expand Up @@ -145,7 +146,7 @@ sentryTest('should capture Supabase authentication errors', async ({ getLocalTes
trace_id: transactionEvent.contexts?.trace?.trace_id,
status: 'internal_error',
data: expect.objectContaining({
'sentry.op': 'db',
[SENTRY_OP]: 'db',
'sentry.origin': 'auto.db.supabase',
'db.operation': 'auth.signInWithPassword',
'db.system': 'postgresql',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
Expand All @@ -7,7 +8,7 @@ Sentry.init({
integrations: [Sentry.browserTracingIntegration(), Sentry.spanStreamingIntegration()],
tracesSampleRate: 1,
beforeSendSpan: Sentry.withStreamedSpan(span => {
if (span.attributes['sentry.op'] === 'pageload') {
if (span.attributes[SENTRY_OP] === 'pageload') {
span.name = 'customPageloadSpanName';
span.links = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { expect } from '@playwright/test';
import {
SDK_VERSION,
SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS,
Expand All @@ -18,6 +17,7 @@ import {
SENTRY_SDK_NAME,
SENTRY_SDK_VERSION,
SENTRY_TRACE_LIFECYCLE,
SENTRY_OP,
} from '@sentry/conventions/attributes';

sentryTest(
Expand Down Expand Up @@ -75,7 +75,7 @@ sentryTest(
expect(spans).toEqual([
{
attributes: {
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: {
[SENTRY_OP]: {
type: 'string',
value: 'test-child',
},
Expand Down Expand Up @@ -223,7 +223,7 @@ sentryTest(
type: 'string',
value: expect.any(String),
},
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: {
[SENTRY_OP]: {
type: 'string',
value: 'test',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
SDK_VERSION,
SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,
SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
Expand All @@ -14,6 +13,7 @@ import {
SENTRY_SDK_NAME,
SENTRY_SDK_VERSION,
SENTRY_TRACE_LIFECYCLE,
SENTRY_OP,
} from '@sentry/conventions/attributes';
import { sentryTest } from '../../../../utils/fixtures';
import { shouldSkipTracingTest } from '../../../../utils/helpers';
Expand Down Expand Up @@ -73,7 +73,7 @@ sentryTest('captures streamed interaction span tree. @firefox', async ({ browser
type: 'string',
value: 'idleTimeout',
},
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: {
[SENTRY_OP]: {
type: 'string',
value: 'ui.action.click',
},
Expand Down Expand Up @@ -133,7 +133,7 @@ sentryTest('captures streamed interaction span tree. @firefox', async ({ browser
type: 'string',
value: 'stream',
},
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: {
[SENTRY_OP]: {
type: 'string',
value: 'ui.interaction.click',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { sentryTest } from '../../../../utils/fixtures';
import { shouldSkipTracingTest } from '../../../../utils/helpers';
import { getSpanOp, waitForStreamedSpans } from '../../../../utils/spanUtils';
Expand Down Expand Up @@ -45,7 +45,7 @@ sentryTest(
value: 'https://sentry-test-site.example/path/to/script.js',
},
'browser.script.invoker_type': { type: 'string', value: 'classic-script' },
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: { type: 'string', value: 'auto.ui.browser.metrics' },
}),
}),
Expand Down Expand Up @@ -94,7 +94,7 @@ sentryTest('captures long animation frame span for event listener.', async ({ br
'browser.script.invoker': { type: 'string', value: 'BUTTON#clickme.onclick' },
'browser.script.invoker_type': { type: 'string', value: 'event-listener' },
'code.filepath': { type: 'string', value: 'https://sentry-test-site.example/path/to/script.js' },
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: { type: 'string', value: 'auto.ui.browser.metrics' },
}),
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SENTRY_OP } from '@sentry/conventions/attributes';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
Expand Down Expand Up @@ -44,7 +45,7 @@ sentryTest(
'browser.script.source_char_position': 0,
'browser.script.invoker': 'https://sentry-test-site.example/path/to/script.js',
'browser.script.invoker_type': 'classic-script',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.long-animation-frame',
[SENTRY_OP]: 'ui.long-animation-frame',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
}),
Expand Down Expand Up @@ -98,7 +99,7 @@ sentryTest(
'browser.script.invoker': 'BUTTON#clickme.onclick',
'browser.script.invoker_type': 'event-listener',
'code.filepath': 'https://sentry-test-site.example/path/to/script.js',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.long-animation-frame',
[SENTRY_OP]: 'ui.long-animation-frame',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';

import { sentryTest } from '../../../../utils/fixtures';
import { shouldSkipTracingTest } from '../../../../utils/helpers';
import { getSpanOp, waitForStreamedSpans } from '../../../../utils/spanUtils';
Expand Down Expand Up @@ -47,7 +48,7 @@ sentryTest(
value: 'https://sentry-test-site.example/path/to/script.js',
},
'browser.script.invoker_type': { type: 'string', value: 'classic-script' },
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: { type: 'string', value: 'auto.ui.browser.metrics' },
}),
}),
Expand Down Expand Up @@ -96,7 +97,7 @@ sentryTest('captures long animation frame span for event listener.', async ({ br
'browser.script.invoker': { type: 'string', value: 'BUTTON#clickme.onclick' },
'browser.script.invoker_type': { type: 'string', value: 'event-listener' },
'code.filepath': { type: 'string', value: 'https://sentry-test-site.example/path/to/script.js' },
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SENTRY_OP]: { type: 'string', value: 'ui.long-animation-frame' },
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: { type: 'string', value: 'auto.ui.browser.metrics' },
}),
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
import { SENTRY_OP } from '@sentry/conventions/attributes';
import type { Event } from '@sentry/core';
import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
Expand Down Expand Up @@ -46,7 +47,7 @@ sentryTest(
'browser.script.source_char_position': 0,
'browser.script.invoker': 'https://sentry-test-site.example/path/to/script.js',
'browser.script.invoker_type': 'classic-script',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.long-animation-frame',
[SENTRY_OP]: 'ui.long-animation-frame',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
}),
Expand Down Expand Up @@ -100,7 +101,7 @@ sentryTest(
'browser.script.invoker': 'BUTTON#clickme.onclick',
'browser.script.invoker_type': 'event-listener',
'code.filepath': 'https://sentry-test-site.example/path/to/script.js',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.long-animation-frame',
[SENTRY_OP]: 'ui.long-animation-frame',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.browser.metrics',
},
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import { sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -28,7 +29,7 @@ sentryTest('captures long task.', async ({ browserName, getLocalTestUrl, page })
name: 'Main UI thread blocked',
parent_span_id: pageloadSpan.span_id,
attributes: expect.objectContaining({
'sentry.op': { type: 'string', value: 'ui.long-task' },
[SENTRY_OP]: { type: 'string', value: 'ui.long-task' },
}),
}),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { expect } from '@playwright/test';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
Expand Down Expand Up @@ -47,14 +47,14 @@ sentryTest(
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SENTRY_OP]: 'pageload',
['sentry.idle_span_finish_reason']: 'cancelled',
});
expect(navigationRequest.contexts?.trace?.data).toMatchObject({
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
[SENTRY_OP]: 'navigation',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});
expect(pageloadRequest.request).toEqual({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { expect } from '@playwright/test';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '@sentry/core';
import { sentryTest } from '../../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../../utils/helpers';
import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes';
import { URL_FULL, URL_PATH, SENTRY_OP } from '@sentry/conventions/attributes';

sentryTest(
'creates a pageload and navigation root spans each with multiple navigation.redirect childspans',
Expand Down Expand Up @@ -35,7 +34,7 @@ sentryTest(
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SENTRY_OP]: 'pageload',
['sentry.idle_span_finish_reason']: 'cancelled',
});

Expand All @@ -55,7 +54,7 @@ sentryTest(
expect(redirectSpan?.timestamp).toEqual(redirectSpan?.start_timestamp);
expect(redirectSpan).toEqual({
data: {
'sentry.op': 'navigation.redirect',
[SENTRY_OP]: 'navigation.redirect',
'sentry.origin': 'auto.navigation.browser',
'sentry.source': 'url',
[URL_FULL]: expect.any(String),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { expect } from '@playwright/test';
import {
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
} from '@sentry/core';
import { sentryTest } from '../../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../../utils/helpers';
import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes';
import { URL_FULL, URL_PATH, SENTRY_OP } from '@sentry/conventions/attributes';

sentryTest('creates a pageload root span with navigation.redirect childspan', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
Expand All @@ -28,7 +27,7 @@ sentryTest('creates a pageload root span with navigation.redirect childspan', as
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
[SENTRY_OP]: 'pageload',
['sentry.idle_span_finish_reason']: 'idleTimeout',
});

Expand All @@ -51,7 +50,7 @@ sentryTest('creates a pageload root span with navigation.redirect childspan', as
expect(redirectSpan?.timestamp).toEqual(redirectSpan?.start_timestamp);
expect(redirectSpan).toEqual({
data: {
'sentry.op': 'navigation.redirect',
[SENTRY_OP]: 'navigation.redirect',
'sentry.origin': 'auto.navigation.browser',
'sentry.source': 'url',
[URL_FULL]: 'http://sentry-test.io/sub-page',
Expand Down
Loading