Skip to content

Commit 30cea03

Browse files
committed
Merge branch 'develop' into timfish/feat/disable-blocked-detection
2 parents 13c8f00 + cc8cd7e commit 30cea03

File tree

7 files changed

+27
-22
lines changed

7 files changed

+27
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
Work in this release was contributed by @janpapenbrock. Thank you for your contribution!
8+
79
## 9.38.0
810

911
### Important Changes

dev-packages/e2e-tests/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ async function run(): Promise<void> {
8484
const cwd = tmpDirPath;
8585

8686
console.log(`Building ${testAppPath} in ${tmpDirPath}...`);
87-
await asyncExec('pnpm test:build', { env, cwd });
87+
await asyncExec('volta run pnpm test:build', { env, cwd });
8888

8989
console.log(`Testing ${testAppPath}...`);
90-
await asyncExec('pnpm test:assert', { env, cwd });
90+
await asyncExec('volta run pnpm test:assert', { env, cwd });
9191

9292
// clean up (although this is tmp, still nice to do)
9393
await rm(tmpDirPath, { recursive: true });

packages/aws-serverless/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "9.38.0",
44
"description": "Official Sentry SDK for AWS Lambda and AWS Serverless Environments",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
6-
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/serverless",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless",
77
"author": "Sentry",
88
"license": "MIT",
99
"engines": {

packages/core/src/logs/exports.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { Scope, ScopeData } from '../scope';
77
import type { Log, SerializedLog, SerializedLogAttributeValue } from '../types-hoist/log';
88
import { mergeScopeData } from '../utils/applyScopeDataToEvent';
99
import { isParameterizedString } from '../utils/is';
10-
import { debug } from '../utils/logger';
10+
import { consoleSandbox, debug } from '../utils/logger';
1111
import { _getSpanForScope } from '../utils/spanOnScope';
1212
import { timestampInSeconds } from '../utils/time';
1313
import { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants';
@@ -168,7 +168,8 @@ export function _INTERNAL_captureLog(
168168

169169
client.emit('beforeCaptureLog', processedLog);
170170

171-
const log = beforeSendLog ? beforeSendLog(processedLog) : processedLog;
171+
// We need to wrap this in `consoleSandbox` to avoid recursive calls to `beforeSendLog`
172+
const log = beforeSendLog ? consoleSandbox(() => beforeSendLog(processedLog)) : processedLog;
172173
if (!log) {
173174
client.recordDroppedEvent('before_send', 'log_item', 1);
174175
DEBUG_BUILD && debug.warn('beforeSendLog returned null, log will not be captured.');

packages/node-native/src/event-loop-block-integration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
Integration,
1111
IntegrationFn,
1212
} from '@sentry/core';
13-
import { defineIntegration, getClient, getFilenameToDebugIdMap, getIsolationScope, logger } from '@sentry/core';
13+
import { debug, defineIntegration, getClient, getFilenameToDebugIdMap, getIsolationScope } from '@sentry/core';
1414
import type { NodeClient } from '@sentry/node';
1515
import { registerThread, threadPoll } from '@sentry-internal/node-native-stacktrace';
1616
import type { ThreadBlockedIntegrationOptions, WorkerStartData } from './common';
@@ -20,7 +20,7 @@ const INTEGRATION_NAME = 'ThreadBlocked';
2020
const DEFAULT_THRESHOLD_MS = 1_000;
2121

2222
function log(message: string, ...args: unknown[]): void {
23-
logger.log(`[Sentry Event Loop Blocked] ${message}`, ...args);
23+
debug.log(`[Sentry Event Loop Blocked] ${message}`, ...args);
2424
}
2525

2626
/**
@@ -107,7 +107,7 @@ async function startWorker(
107107
}
108108

109109
const options: WorkerStartData = {
110-
debug: logger.isEnabled(),
110+
debug: debug.isEnabled(),
111111
dsn,
112112
tunnel: initOptions.tunnel,
113113
environment: initOptions.environment || 'production',

packages/vercel-edge/src/sdk.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { Client, Integration, Options } from '@sentry/core';
1010
import {
1111
consoleIntegration,
1212
createStackParser,
13+
debug,
1314
dedupeIntegration,
1415
functionToStringIntegration,
1516
getCurrentScope,
@@ -18,7 +19,6 @@ import {
1819
hasSpansEnabled,
1920
inboundFiltersIntegration,
2021
linkedErrorsIntegration,
21-
logger,
2222
nodeStackLineParser,
2323
requestDataIntegration,
2424
SDK_VERSION,
@@ -135,14 +135,14 @@ function validateOpenTelemetrySetup(): void {
135135

136136
for (const k of required) {
137137
if (!setup.includes(k)) {
138-
logger.error(
138+
debug.error(
139139
`You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`,
140140
);
141141
}
142142
}
143143

144144
if (!setup.includes('SentrySampler')) {
145-
logger.warn(
145+
debug.warn(
146146
'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.',
147147
);
148148
}
@@ -182,19 +182,21 @@ export function setupOtel(client: VercelEdgeClient): void {
182182
}
183183

184184
/**
185-
* Setup the OTEL logger to use our own logger.
185+
* Setup the OTEL logger to use our own debug logger.
186186
*/
187187
function setupOpenTelemetryLogger(): void {
188-
const otelLogger = new Proxy(logger as typeof logger & { verbose: (typeof logger)['debug'] }, {
189-
get(target, prop, receiver) {
190-
const actualProp = prop === 'verbose' ? 'debug' : prop;
191-
return Reflect.get(target, actualProp, receiver);
192-
},
193-
});
194-
195188
// Disable diag, to ensure this works even if called multiple times
196189
diag.disable();
197-
diag.setLogger(otelLogger, DiagLogLevel.DEBUG);
190+
diag.setLogger(
191+
{
192+
error: debug.error,
193+
warn: debug.warn,
194+
info: debug.log,
195+
debug: debug.log,
196+
verbose: debug.log,
197+
},
198+
DiagLogLevel.DEBUG,
199+
);
198200
}
199201

200202
/**

packages/vercel-edge/src/vendored/async-local-storage-context-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
import type { Context } from '@opentelemetry/api';
2929
import { ROOT_CONTEXT } from '@opentelemetry/api';
30-
import { GLOBAL_OBJ, logger } from '@sentry/core';
30+
import { debug, GLOBAL_OBJ } from '@sentry/core';
3131
import type { AsyncLocalStorage } from 'async_hooks';
3232
import { DEBUG_BUILD } from '../debug-build';
3333
import { AbstractAsyncHooksContextManager } from './abstract-async-hooks-context-manager';
@@ -42,7 +42,7 @@ export class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextMa
4242

4343
if (!MaybeGlobalAsyncLocalStorageConstructor) {
4444
DEBUG_BUILD &&
45-
logger.warn(
45+
debug.warn(
4646
"Tried to register AsyncLocalStorage async context strategy in a runtime that doesn't support AsyncLocalStorage.",
4747
);
4848

0 commit comments

Comments
 (0)