Skip to content

Commit 6ed71ed

Browse files
authored
ref(gcp-serverless): Remove setting .__sentry_transaction (#11346)
we shouldn't be setting `res.__sentry_transaction`, opportunity for memory leaks + users should be able to get correct span from isolation scope.
1 parent 4bb4b62 commit 6ed71ed

File tree

1 file changed

+0
-9
lines changed
  • packages/google-cloud-serverless/src/gcpfunction

1 file changed

+0
-9
lines changed

packages/google-cloud-serverless/src/gcpfunction/http.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
33
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
4-
Transaction,
54
handleCallbackErrors,
65
setHttpStatus,
76
} from '@sentry/core';
@@ -59,14 +58,6 @@ function _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>):
5958
request: req,
6059
});
6160

62-
if (span instanceof Transaction) {
63-
// We also set __sentry_transaction on the response so people can grab the transaction there to add
64-
// spans to it later.
65-
// TODO(v8): Remove this
66-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
67-
(res as any).__sentry_transaction = span;
68-
}
69-
7061
// eslint-disable-next-line @typescript-eslint/unbound-method
7162
const _end = res.end;
7263
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)