Skip to content

Commit fbaa9c3

Browse files
minwookshincodex
andcommitted
refactor(server-utils): move response streaming classifier from core
Co-Authored-By: OpenAI Codex <codex@openai.com>
1 parent e39a1ce commit fbaa9c3

6 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎packages/bun/src/integrations/bunserver.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Integration, IntegrationFn, MaxRequestBodySize, SpanAttributes } f
22
import {
33
captureBodyFromWinterCGRequest,
44
captureException,
5-
classifyResponseStreaming,
65
continueTrace,
76
defineIntegration,
87
getClient,
@@ -23,6 +22,7 @@ import {
2322
filterCollectedUrlQuery,
2423
} from '@sentry/core';
2524
import { getClientIPAddress } from '@sentry/core/server';
25+
import { classifyResponseStreaming } from '@sentry/server-utils';
2626
import type { Server, ServeOptions } from 'bun';
2727
import {
2828
CLIENT_ADDRESS,

‎packages/core/src/index.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,3 @@ export {
541541
} from './utils/randomSafeContext';
542542
export { warnOnRemovedBuildOptions } from './build-time-plugins/warnOnRemovedBuildOptions';
543543
export { startSpan, startInactiveSpan, startSpanManual } from './tracing/trace';
544-
545-
export { classifyResponseStreaming } from './utils/responseStreaming';
546-
export type { StreamingGuess } from './utils/responseStreaming';

‎packages/deno/src/utils/streaming.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Span } from '@sentry/core';
2-
import { classifyResponseStreaming } from '@sentry/core';
2+
import { classifyResponseStreaming } from '@sentry/server-utils';
33

4-
export { classifyResponseStreaming } from '@sentry/core';
5-
export type { StreamingGuess } from '@sentry/core';
4+
export { classifyResponseStreaming } from '@sentry/server-utils';
5+
export type { StreamingGuess } from '@sentry/server-utils';
66

77
/**
88
* Tee a stream, and end the provided span when the stream ends.

‎packages/server-utils/src/exports.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Shared exports not using diagnostics channels
2+
export { classifyResponseStreaming } from './utils/responseStreaming';
3+
export type { StreamingGuess } from './utils/responseStreaming';
24
export { setHttpServerSpanRouteAttribute } from './utils/setHttpServerSpanRouteAttribute';
35
export { setAsyncLocalStorageAsyncContextStrategy } from './async-context';
46
export { openTelemetryIntegration, getOtlpTracesEndpoint } from './opentelemetry';
File renamed without changes.

packages/core/test/lib/utils/responseStreaming.test.ts renamed to packages/server-utils/test/utils/responseStreaming.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from 'vitest';
2-
import { classifyResponseStreaming } from '../../../src/utils/responseStreaming';
2+
import { classifyResponseStreaming } from '../../src/utils/responseStreaming';
33

44
describe('classifyResponseStreaming', () => {
55
test.each([

0 commit comments

Comments
 (0)