Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { createServer } from 'http';

const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
traceLifecycle: 'static',
dsn: process.env.E2E_TEST_DSN,
environment: 'qa',
debug: !!process.env.DEBUG,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { expect, test } from '@playwright/test';
import { collectStreamedSpans, getSpanOp, waitForStreamedSpan } from '@sentry-internal/test-utils';

['test-success', 'test-error'].forEach(route => {
test(`Sends an HTTP segment for ${route}`, async ({ baseURL }) => {
const spanPromise = waitForStreamedSpan(
'effect-3-node',
span =>
span.is_segment && getSpanOp(span) === 'http.server' && span.attributes['url.path']?.value === `/${route}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTP wait uses missing attribute

High Severity

The HTTP segment wait matches on url.path, but Effect HTTP spans from SentryEffectTracer never set that attribute, and effectLayer disables Node default integrations. The predicate never matches, so these tests time out.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 53d4981. Configure here.

@msonnb msonnb Sep 8, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect, it's set by effect

);

await fetch(`${baseURL}/${route}`);

const span = await spanPromise;
expect(span.name).toBe('http.server GET');
expect(span.attributes['sentry.origin']?.value).toBe('auto.http.effect');
});
});

test('Sends a manual Effect span', async ({ baseURL }) => {
const spansPromise = collectStreamedSpans(
'effect-3-node',
spans =>
spans.some(span => span.is_segment && getSpanOp(span) === 'http.server') &&
spans.some(span => span.name === 'test-span'),
);

await fetch(`${baseURL}/test-transaction`);

const spans = await spansPromise;
const segment = spans.find(span => span.is_segment)!;
const children = spans.filter(span => !span.is_segment);
expect(segment.name).toBe('http.server GET');
expect(children).toHaveLength(1);
expect(children[0]).toMatchObject({ name: 'test-span', parent_span_id: segment.span_id });
});

test('Sends Effect spans with correct parent-child structure', async ({ baseURL }) => {
const spansPromise = collectStreamedSpans(
'effect-3-node',
spans =>
spans.some(span => span.is_segment && getSpanOp(span) === 'http.server') &&
spans.some(span => span.name === 'custom-effect-span') &&
spans.some(span => span.name === 'nested-span'),
);

await fetch(`${baseURL}/test-effect-span`);

const spans = await spansPromise;
const segment = spans.find(span => span.is_segment)!;
const children = spans.filter(span => !span.is_segment);
expect(segment.name).toBe('http.server GET');
expect(segment.attributes['sentry.origin']?.value).toBe('auto.http.effect');
expect(segment.attributes['sentry.sdk.name']?.value).toBe('sentry.javascript.effect');
expect(children).toHaveLength(2);
const parent = children.find(span => span.name === 'custom-effect-span')!;
const nested = children.find(span => span.name === 'nested-span')!;
expect(parent.parent_span_id).toBe(segment.span_id);
expect(nested.parent_span_id).toBe(parent.span_id);
for (const child of children) {
expect(getSpanOp(child)).toBe('function');
expect(child.attributes['sentry.origin']?.value).toBe('auto.function.effect');
expect(child.trace_id).toBe(segment.trace_id);
}
});

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { createServer } from 'http';

const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
traceLifecycle: 'static',
dsn: process.env.E2E_TEST_DSN,
environment: 'qa',
debug: !!process.env.DEBUG,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { expect, test } from '@playwright/test';
import { collectStreamedSpans, getSpanOp, waitForStreamedSpan } from '@sentry-internal/test-utils';

['test-success', 'test-error'].forEach(route => {
test(`Sends an HTTP segment for ${route}`, async ({ baseURL }) => {
const spanPromise = waitForStreamedSpan(
'effect-4-node',
span =>
span.is_segment && getSpanOp(span) === 'http.server' && span.attributes['url.path']?.value === `/${route}`,
);

await fetch(`${baseURL}/${route}`);

const span = await spanPromise;
expect(span.name).toBe('http.server GET');
expect(span.attributes['sentry.origin']?.value).toBe('auto.http.effect');
});
});

test('Sends a manual Effect span', async ({ baseURL }) => {
const spansPromise = collectStreamedSpans(
'effect-4-node',
spans =>
spans.some(span => span.is_segment && getSpanOp(span) === 'http.server') &&
spans.some(span => span.name === 'test-span'),
);

await fetch(`${baseURL}/test-transaction`);

const spans = await spansPromise;
const segment = spans.find(span => span.is_segment)!;
const children = spans.filter(span => !span.is_segment);
expect(segment.name).toBe('http.server GET');
expect(children).toHaveLength(1);
expect(children[0]).toMatchObject({ name: 'test-span', parent_span_id: segment.span_id });
});

test('Sends Effect spans with correct parent-child structure', async ({ baseURL }) => {
const spansPromise = collectStreamedSpans(
'effect-4-node',
spans =>
spans.some(span => span.is_segment && getSpanOp(span) === 'http.server') &&
spans.some(span => span.name === 'custom-effect-span') &&
spans.some(span => span.name === 'nested-span'),
);

await fetch(`${baseURL}/test-effect-span`);

const spans = await spansPromise;
const segment = spans.find(span => span.is_segment)!;
const children = spans.filter(span => !span.is_segment);
expect(segment.name).toBe('http.server GET');
expect(segment.attributes['sentry.origin']?.value).toBe('auto.http.effect');
expect(segment.attributes['sentry.sdk.name']?.value).toBe('sentry.javascript.effect');
expect(children).toHaveLength(2);
const parent = children.find(span => span.name === 'custom-effect-span')!;
const nested = children.find(span => span.name === 'nested-span')!;
expect(parent.parent_span_id).toBe(segment.span_id);
expect(nested.parent_span_id).toBe(parent.span_id);
for (const child of children) {
expect(getSpanOp(child)).toBe('function');
expect(child.attributes['sentry.origin']?.value).toBe('auto.function.effect');
expect(child.trace_id).toBe(segment.trace_id);
}
});

This file was deleted.

Loading