Skip to content

Commit 5b3770c

Browse files
mydeaclaude
andcommitted
ref!: Use auto.http.http_server origin for all node:http server spans
The shared core server instrumentation, used by `@sentry/bun` and `@sentry/deno` for `node:http` servers, tagged its spans `auto.http.server`, while Node's `httpServerSpansIntegration` uses `auto.http.http_server` for the same kind of span. Use one origin for both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a01cfca commit 5b3770c

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎dev-packages/bun-integration-tests/node-suites/excludes.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ const FETCH_INTEGRATION_DIFFERS = [
161161
// `@sentry/bun` creates `http.server` spans with `bunHttpServerIntegration`, not `httpIntegration`,
162162
// so the incoming-request options that the scenario passes to `httpIntegration` (for example
163163
// `sessionFlushingDelayMS`, `onSpanCreated`, `ignoreIncomingRequests`, `ignoreStaticAssets`) have
164-
// no effect. Its spans also differ: the origin is `auto.http.server`, not `auto.http.http_server`,
165-
// response headers become attributes, and there is no `http.response.status_text`. And a server
164+
// no effect. Its spans also differ: response headers become attributes, and there is no
165+
// `http.response.status_text`. And a server
166166
// that sets `emit` back to the `emit` it had before its first request gets no spans after that.
167167
const HTTP_SERVER_OPTIONS_IGNORED = [
168168
'suites/sessions/exited-session-aggregate/test.ts',

‎packages/bun/test/integrations/bunHttpServer.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Bun HTTP Server Integration', () => {
5656
// No router resolves a route here, so with span streaming the name is the request method.
5757
expect(span?.name).toBe('GET');
5858
expect(span?.attributes['url.path']).toBe('/users');
59-
expect(span?.attributes['sentry.origin']).toBe('auto.http.server');
59+
expect(span?.attributes['sentry.origin']).toBe('auto.http.http_server');
6060
});
6161

6262
test('creates an http.server span for incoming QUERY requests', async () => {

‎packages/core/src/integrations/http/server-subscription.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function buildServerSpanWrap(
326326
attributes: {
327327
// Sentry-specific attributes
328328
[SENTRY_OP]: HTTP_SERVER,
329-
[SENTRY_ORIGIN]: 'auto.http.server',
329+
[SENTRY_ORIGIN]: 'auto.http.http_server',
330330
[SENTRY_SEGMENT_NAME_SOURCE]: 'url',
331331
[SENTRY_KIND]: 'server',
332332
// Network attributes

‎packages/core/test/lib/integrations/http/server-subscription.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ describe('getHttpServerSubscriptions', () => {
118118
expect(transaction.contexts?.trace).toEqual(
119119
expect.objectContaining({
120120
op: 'http.server',
121-
origin: 'auto.http.server',
121+
origin: 'auto.http.http_server',
122122
data: expect.objectContaining({
123123
'http.request.method': 'GET',
124124
'http.response.status_code': 200,
125125
'sentry.kind': 'server',
126126
'sentry.op': 'http.server',
127-
'sentry.origin': 'auto.http.server',
127+
'sentry.origin': 'auto.http.http_server',
128128
'sentry.segment.name.source': 'url',
129129
[URL_FULL]: expect.stringMatching(/\/users\/42\?foo=bar$/),
130130
[URL_PATH]: '/users/42',

‎packages/core/test/lib/integrations/http/server-transaction-event.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ describe('processHttpServerTransactionEvent', () => {
7979
contexts: { trace: { origin: 'auto.http.deno', data: { 'http.response.status_code': 404 } } },
8080
} as Event;
8181
// Would be dropped without the gate; the origin does not match, so it passes through.
82-
expect(processHttpServerTransactionEvent(event, [404], 'auto.http.server')).toBe(event);
82+
expect(processHttpServerTransactionEvent(event, [404], 'auto.http.http_server')).toBe(event);
8383
});
8484

8585
it('acts on events whose span origin matches', () => {
8686
const event = {
8787
...transaction(404),
88-
contexts: { trace: { origin: 'auto.http.server', data: { 'http.response.status_code': 404 } } },
88+
contexts: { trace: { origin: 'auto.http.http_server', data: { 'http.response.status_code': 404 } } },
8989
} as Event;
90-
expect(processHttpServerTransactionEvent(event, [404], 'auto.http.server')).toBeNull();
90+
expect(processHttpServerTransactionEvent(event, [404], 'auto.http.http_server')).toBeNull();
9191
});
9292

9393
it('acts on every origin when spanOrigin is omitted', () => {

‎packages/deno/src/integrations/http.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const _denoHttpIntegration = ((options: DenoHttpIntegrationOptions = {}) => {
162162
processEvent(event: Event): Event | null {
163163
// Gated on this integration's own span origin so it does not filter `Deno.serve`
164164
// transactions, which `denoServeIntegration` owns via its own `ignoreStatusCodes`.
165-
return processHttpServerTransactionEvent(event, ignoreStatusCodes, 'auto.http.server');
165+
return processHttpServerTransactionEvent(event, ignoreStatusCodes, 'auto.http.http_server');
166166
},
167167
setupOnce() {
168168
const { [HTTP_ON_SERVER_REQUEST]: onHttpServerRequest } = getHttpServerSubscriptions({

0 commit comments

Comments
 (0)