8000 feat(opentelemetry): Export `getRequestSpanData` (#11508) · basarat/sentry-javascript@4759d4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 4759d4c

Browse files
authored
feat(opentelemetry): Export getRequestSpanData (getsentry#11508)
Instead of exporting `_INTERNAL` here, it's OK IMHO to export this. The API is stable enough.
1 parent cdf20be commit 4759d4c

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

packages/node/src/integrations/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
setCapturedScopesOnSpan,
1515
spanToJSON,
1616
} from '@sentry/core';
17-
import { _INTERNAL, getClient, getSpanKind } from '@sentry/opentelemetry';
17+
import { getClient, getRequestSpanData, getSpanKind } from '@sentry/opentelemetry';
1818
import type { IntegrationFn } from '@sentry/types';
1919

2020
import { stripUrlQueryAndFragment } from '@sentry/utils';
@@ -162,7 +162,7 @@ function _addRequestBreadcrumb(span: Span, response: HTTPModuleRequestIncomingMe
162162
return;
163163
}
164164

165-
const data = _INTERNAL.getRequestSpanData(span);
165+
const data = getRequestSpanData(span);
166166
addBreadcrumb(
167167
{
168168
category: 'http',

packages/node/src/integrations/node-fetch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SpanKind } from '@opentelemetry/api';
33
import type { Instrumentation } from '@opentelemetry/instrumentation';
44
import { registerInstrumentations } from '@opentelemetry/instrumentation';
55
import { addBreadcrumb, defineIntegration } from '@sentry/core';
6-
import { _INTERNAL, getSpanKind } from '@sentry/opentelemetry';
6+
import { getRequestSpanData, getSpanKind } from '@sentry/opentelemetry';
77
import type { IntegrationFn } from '@sentry/types';
88
import { logger } from '@sentry/utils';
99
import { DEBUG_BUILD } from '../debug-build';
@@ -88,7 +88,7 @@ function _addRequestBreadcrumb(span: Span): void {
8888
return;
8989
}
9090

91-
const data = _INTERNAL.getRequestSpanData(span);
91+
const data = getRequestSpanData(span);
9292
addBreadcrumb({
9393
category: 'http',
9494
data: {

packages/opentelemetry/src/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getRequestSpanData } from './utils/getRequestSpanData';
1+
export { getRequestSpanData } from './utils/getRequestSpanData';
22

33
export type { OpenTelemetryClient } from './types';
44
export { wrapClientClass } from './custom/client';
@@ -39,13 +39,3 @@ export { openTelemetrySetupCheck } from './utils/setupCheck';
3939

4040
// Legacy
4141
export { getClient } from '@sentry/core';
42-
43-
/**
44-
* The following internal utils are not considered public API and are subject to change.
45-
* @hidden
46-
*/
47-
const _INTERNAL = {
48-
getRequestSpanData,
49-
} as const;
50-
51-
export { _INTERNAL };

0 commit comments

Comments
 (0)
0