Skip to content

Commit

Permalink
rename to setRequestEventData
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 18, 2024
1 parent be96f6c commit a56fc65
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export { hasTracingEnabled } from './utils/hasTracingEnabled';
export { isSentryRequestUrl } from './utils/isSentryRequestUrl';
export { handleCallbackErrors } from './utils/handleCallbackErrors';
export { parameterize } from './utils/parameterize';
export { setNormalizedRequest } from './utils/sdkProcessingMetadata';
export { setRequestEventData } from './utils/sdkProcessingMetadata';
export {
spanToTraceHeader,
spanToJSON,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/sdkProcessingMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function mergeSdkProcessingMetadata(
* By default, this will put this data on the isolation scope,
* but you can also pass a different scope to set the data on.
*/
export function setNormalizedRequest(normalizedRequest: Request, scope = getIsolationScope()): void {
export function setRequestEventData(normalizedRequest: Request, scope = getIsolationScope()): void {
const normalizedRequestBefore = scope.getScopeData().sdkProcessingMetadata['normalizedRequest'];

const newNormalizedRequest = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { VERSION } from '@opentelemetry/core';
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
import { getRequestInfo } from '@opentelemetry/instrumentation-http';
import { addBreadcrumb, getClient, getIsolationScope, setNormalizedRequest, withIsolationScope } from '@sentry/core';
import { addBreadcrumb, getClient, getIsolationScope, setRequestEventData, withIsolationScope } from '@sentry/core';
import type { PolymorphicRequest, RequestEventData, SanitizedRequestData, Scope } from '@sentry/types';
import {
getBreadcrumbLogLevelFromHttpStatusCode,
Expand Down Expand Up @@ -155,7 +155,7 @@ export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpIns
// Update the isolation scope, isolate this request
// TODO(v9): Stop setting `request`, we only rely on normalizedRequest anymore
isolationScope.setSDKProcessingMetadata({ request });
setNormalizedRequest(normalizedRequest, isolationScope);
setRequestEventData(normalizedRequest, isolationScope);

const client = getClient<NodeClient>();
if (client && client.getOptions().autoSessionTracking) {
Expand Down Expand Up @@ -399,7 +399,7 @@ function patchRequestToCaptureBody(req: IncomingMessage, isolationScope: Scope):
const body = Buffer.concat(chunks).toString('utf-8');

if (body) {
setNormalizedRequest({ data: body }, isolationScope);
setRequestEventData({ data: body }, isolationScope);
}
} catch {
// ignore errors here
Expand Down

0 comments on commit a56fc65

Please sign in to comment.