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 @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-http/${id}`,
'url.full': `http://localhost:3030/test-outgoing-http/${id}`,
'url.path': `/test-outgoing-http/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -103,6 +105,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -193,6 +197,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.path': `/test-outgoing-fetch/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -232,6 +238,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction from module', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/example-module/transaction',
'url.full': 'http://localhost:3030/example-module/transaction',
'url.path': '/example-module/transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction from module', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/example-module/transaction',
'url.full': 'http://localhost:3030/example-module/transaction',
'url.path': '/example-module/transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-http/${id}`,
'url.full': `http://localhost:3030/test-outgoing-http/${id}`,
'url.path': `/test-outgoing-http/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -103,6 +105,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -193,6 +197,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.path': `/test-outgoing-fetch/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -232,6 +238,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-http/${id}`,
'url.full': `http://localhost:3030/test-outgoing-http/${id}`,
'url.path': `/test-outgoing-http/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -103,6 +105,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -193,6 +197,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.path': `/test-outgoing-fetch/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -232,6 +238,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-http/${id}`,
'url.full': `http://localhost:3030/test-outgoing-http/${id}`,
'url.path': `/test-outgoing-http/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -103,6 +105,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -193,6 +197,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.path': `/test-outgoing-fetch/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -232,6 +238,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ test('Sends successful transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-success',
'url.full': 'http://localhost:3030/test-success',
'url.path': '/test-success',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-http/${id}`,
'url.full': `http://localhost:3030/test-outgoing-http/${id}`,
'url.path': `/test-outgoing-http/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -102,6 +104,8 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -192,6 +196,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.full': `http://localhost:3030/test-outgoing-fetch/${id}`,
'url.path': `/test-outgoing-fetch/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down Expand Up @@ -231,6 +237,8 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': `http://localhost:3030/test-inbound-headers/${id}`,
'url.full': `http://localhost:3030/test-inbound-headers/${id}`,
'url.path': `/test-inbound-headers/${id}`,
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ test('Sends a sampled API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/task',
'url.full': 'http://localhost:3030/task',
'url.path': '/task',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ test('server pageload request span has nested request span for sub request', asy
'http.method': 'GET',
'http.route': '/api/users',
'http.url': 'http://localhost:3030/api/users',
'url.full': 'http://localhost:3030/api/users',
'url.path': '/api/users',
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.sveltekit',
'sentry.source': 'route',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test('Sends an API route transaction', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'http.url': 'http://localhost:3030/test-transaction',
'url.full': 'http://localhost:3030/test-transaction',
'url.path': '/test-transaction',
'http.host': 'localhost:3030',
'net.host.name': 'localhost',
'http.method': 'GET',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createTestServer } from '@sentry-internal/test-utils';
import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes';
import { afterAll, describe, expect, test } from 'vitest';
import { cleanupChildProcesses, createEsmAndCjsTests, createRunner } from '../../../utils/runner';

Expand Down Expand Up @@ -130,6 +131,8 @@ describe('httpIntegration', () => {
'sentry.sample_rate': 1,
'sentry.source': 'route',
url: `http://localhost:${port}/test`,
[URL_FULL]: `http://localhost:${port}/test?a=1&b=2`,
[URL_PATH]: '/test',
...getCommonHttpRequestHeaders(),
});
},
Expand Down Expand Up @@ -172,6 +175,8 @@ describe('httpIntegration', () => {
'sentry.sample_rate': 1,
'sentry.source': 'route',
url: `http://localhost:${port}/test`,
[URL_FULL]: `http://localhost:${port}/test?a=1&b=2`,
[URL_PATH]: '/test',
'http.request.header.content_length': '9',
'http.request.header.content_type': 'text/plain;charset=UTF-8',
...getCommonHttpRequestHeaders(),
Expand Down
3 changes: 3 additions & 0 deletions packages/astro/src/server/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-lines */
import { URL_FULL, URL_PATH } from '@sentry/conventions/attributes';
import type { Span, SpanAttributes } from '@sentry/core';
import {
addNonEnumerableProperty,
Expand Down Expand Up @@ -218,6 +219,8 @@ async function instrumentRequestStartHttpServerSpan(
[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]: method,
// This is here for backwards compatibility, we used to set this here before
method,
[URL_FULL]: ctx.url.href,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Astro take-over omits URL attributes

Medium Severity

enhanceHttpServerSpan takes over an existing http.server span but never sets url.full or url.path, while the create path in the same file does. Sibling take-over paths in this PR (SvelteKit, Next.js edge, React Router) set these with a fallback from the request URL. When the prior span lacks them (relative URL, custom instrumentation), Astro streamed spans cannot infer descriptions.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3b3b0dc. Configure here.

[URL_PATH]: ctx.url.pathname,
url: stripUrlQueryAndFragment(ctx.url.href),
...httpHeadersToSpanAttributes(
winterCGHeadersToDict(request.headers),
Expand Down
Loading
Loading