From a98f73e0172055a1faec8884475378d7b0acf0ad Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 23 Apr 2025 11:04:02 +0200 Subject: [PATCH] ref(core):Remove internal `utils-hoist` re-export --- packages/core/src/currentScopes.ts | 2 +- packages/core/src/index.ts | 150 +++++++++++++++++- packages/core/src/integrations/console.ts | 12 +- packages/core/src/integrations/supabase.ts | 4 +- packages/core/src/logs/console-integration.ts | 5 +- packages/core/src/logs/envelope.ts | 5 +- packages/core/src/logs/exports.ts | 3 +- packages/core/src/mcp-server.ts | 2 +- packages/core/src/server-runtime-client.ts | 2 +- packages/core/src/session.ts | 3 +- packages/core/src/trpc.ts | 2 +- packages/core/src/utils-hoist/index.ts | 140 ---------------- packages/core/test/lib/logs/envelope.test.ts | 21 +-- 13 files changed, 181 insertions(+), 170 deletions(-) delete mode 100644 packages/core/src/utils-hoist/index.ts diff --git a/packages/core/src/currentScopes.ts b/packages/core/src/currentScopes.ts index 6bcdca2ae17b..9dc1c164c387 100644 --- a/packages/core/src/currentScopes.ts +++ b/packages/core/src/currentScopes.ts @@ -3,7 +3,7 @@ import { getGlobalSingleton, getMainCarrier } from './carrier'; import type { Client } from './client'; import { Scope } from './scope'; import type { TraceContext } from './types-hoist'; -import { generateSpanId } from './utils-hoist'; +import { generateSpanId } from './utils-hoist/propagationContext'; /** * Get the currently active scope. diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b5dac82ffa54..be2feb94ff2e 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -120,9 +120,155 @@ export type { ReportDialogOptions } from './report-dialog'; export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/exports'; export { consoleLoggingIntegration } from './logs/console-integration'; -// TODO: Make this structure pretty again and don't do "export *" -export * from './utils-hoist/index'; // TODO: Make this structure pretty again and don't do "export *" export * from './types-hoist/index'; export type { FeatureFlag } from './featureFlags'; + +export { applyAggregateErrorsToEvent } from './utils-hoist/aggregate-errors'; +export { getBreadcrumbLogLevelFromHttpStatusCode } from './utils-hoist/breadcrumb-log-level'; +export { getComponentName, getLocationHref, htmlTreeAsString } from './utils-hoist/browser'; +export { dsnFromString, dsnToString, makeDsn } from './utils-hoist/dsn'; +// eslint-disable-next-line deprecation/deprecation +export { SentryError } from './utils-hoist/error'; +export { GLOBAL_OBJ } from './utils-hoist/worldwide'; +export type { InternalGlobal } from './utils-hoist/worldwide'; +export { addConsoleInstrumentationHandler } from './utils-hoist/instrument/console'; +export { addFetchEndInstrumentationHandler, addFetchInstrumentationHandler } from './utils-hoist/instrument/fetch'; +export { addGlobalErrorInstrumentationHandler } from './utils-hoist/instrument/globalError'; +export { addGlobalUnhandledRejectionInstrumentationHandler } from './utils-hoist/instrument/globalUnhandledRejection'; +export { + addHandler, + maybeInstrument, + resetInstrumentationHandlers, + triggerHandlers, +} from './utils-hoist/instrument/handlers'; +export { + isDOMError, + isDOMException, + isElement, + isError, + isErrorEvent, + isEvent, + isInstanceOf, + isParameterizedString, + isPlainObject, + isPrimitive, + isRegExp, + isString, + isSyntheticEvent, + isThenable, + isVueViewModel, +} from './utils-hoist/is'; +export { isBrowser } from './utils-hoist/isBrowser'; +export { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods } from './utils-hoist/logger'; +export type { Logger } from './utils-hoist/logger'; +export { + addContextToFrame, + addExceptionMechanism, + addExceptionTypeValue, + checkOrSetAlreadyCaught, + getEventDescription, + parseSemver, + uuid4, +} from './utils-hoist/misc'; +export { isNodeEnv, loadModule } from './utils-hoist/node'; +export { normalize, normalizeToSize, normalizeUrlToBase } from './utils-hoist/normalize'; +export { + addNonEnumerableProperty, + convertToPlainObject, + // eslint-disable-next-line deprecation/deprecation + dropUndefinedKeys, + extractExceptionKeysForMessage, + fill, + getOriginalFunction, + markFunctionWrapped, + objectify, +} from './utils-hoist/object'; +export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './utils-hoist/path'; +export { makePromiseBuffer, SENTRY_BUFFER_FULL_ERROR } from './utils-hoist/promisebuffer'; +export type { PromiseBuffer } from './utils-hoist/promisebuffer'; +export { severityLevelFromString } from './utils-hoist/severity'; +export { + UNKNOWN_FUNCTION, + createStackParser, + getFramesFromEvent, + getFunctionName, + stackParserFromStackParserOptions, + stripSentryFramesAndReverse, +} from './utils-hoist/stacktrace'; +export { filenameIsInApp, node, nodeStackLineParser } from './utils-hoist/node-stack-trace'; +export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate } from './utils-hoist/string'; +export { + isNativeFunction, + supportsDOMError, + supportsDOMException, + supportsErrorEvent, + supportsFetch, + supportsHistory, + supportsNativeFetch, + supportsReferrerPolicy, + supportsReportingObserver, +} from './utils-hoist/supports'; +export { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './utils-hoist/syncpromise'; +export { browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds } from './utils-hoist/time'; +export { + TRACEPARENT_REGEXP, + extractTraceparentData, + generateSentryTraceHeader, + propagationContextFromHeaders, +} from './utils-hoist/tracing'; +export { getSDKSource, isBrowserBundle } from './utils-hoist/env'; +export type { SdkSource } from './utils-hoist/env'; +export { + addItemToEnvelope, + createAttachmentEnvelopeItem, + createEnvelope, + createEventEnvelopeHeaders, + createSpanEnvelopeItem, + envelopeContainsItemType, + envelopeItemTypeToDataCategory, + forEachEnvelopeItem, + getSdkMetadataForEnvelopeHeader, + parseEnvelope, + serializeEnvelope, +} from './utils-hoist/envelope'; +export { createClientReportEnvelope } from './utils-hoist/clientreport'; +export { + DEFAULT_RETRY_AFTER, + disabledUntil, + isRateLimited, + parseRetryAfterHeader, + updateRateLimits, +} from './utils-hoist/ratelimit'; +export type { RateLimits } from './utils-hoist/ratelimit'; +export { + MAX_BAGGAGE_STRING_LENGTH, + SENTRY_BAGGAGE_KEY_PREFIX, + SENTRY_BAGGAGE_KEY_PREFIX_REGEX, + baggageHeaderToDynamicSamplingContext, + dynamicSamplingContextToSentryBaggageHeader, + parseBaggageHeader, + objectToBaggageHeader, +} from './utils-hoist/baggage'; +export { + getSanitizedUrlString, + parseUrl, + stripUrlQueryAndFragment, + parseStringToURLObject, + isURLObjectRelative, + getSanitizedUrlStringFromUrlObject, +} from './utils-hoist/url'; +export { + eventFromMessage, + eventFromUnknownInput, + exceptionFromError, + parseStackFrames, +} from './utils-hoist/eventbuilder'; +export { callFrameToStackFrame, watchdogTimer } from './utils-hoist/anr'; +export { LRUMap } from './utils-hoist/lru'; +export { generateTraceId, generateSpanId } from './utils-hoist/propagationContext'; +export { vercelWaitUntil } from './utils-hoist/vercelWaitUntil'; +export { SDK_VERSION } from './utils-hoist/version'; +export { getDebugImagesForResources, getFilenameToDebugIdMap } from './utils-hoist/debug-ids'; +export { escapeStringForRegex } from './utils-hoist/vendor/escapeStringForRegex'; diff --git a/packages/core/src/integrations/console.ts b/packages/core/src/integrations/console.ts index 3cd0bff04a1e..110b94d5fcab 100644 --- a/packages/core/src/integrations/console.ts +++ b/packages/core/src/integrations/console.ts @@ -2,13 +2,11 @@ import { addBreadcrumb } from '../breadcrumbs'; import { getClient } from '../currentScopes'; import { defineIntegration } from '../integration'; import type { ConsoleLevel } from '../types-hoist'; -import { - CONSOLE_LEVELS, - GLOBAL_OBJ, - addConsoleInstrumentationHandler, - safeJoin, - severityLevelFromString, -} from '../utils-hoist'; +import { addConsoleInstrumentationHandler } from '../utils-hoist/instrument/console'; +import { CONSOLE_LEVELS } from '../utils-hoist/logger'; +import { severityLevelFromString } from '../utils-hoist/severity'; +import { safeJoin } from '../utils-hoist/string'; +import { GLOBAL_OBJ } from '../utils-hoist/worldwide'; interface ConsoleIntegrationOptions { levels: ConsoleLevel[]; diff --git a/packages/core/src/integrations/supabase.ts b/packages/core/src/integrations/supabase.ts index f6541da51aa2..6cc6b5637c3e 100644 --- a/packages/core/src/integrations/supabase.ts +++ b/packages/core/src/integrations/supabase.ts @@ -2,8 +2,6 @@ // https://github.com/supabase-community/sentry-integration-js /* eslint-disable max-lines */ -import { logger, isPlainObject } from '../utils-hoist'; - import type { IntegrationFn } from '../types-hoist'; import { setHttpStatus, startSpan } from '../tracing'; import { addBreadcrumb } from '../breadcrumbs'; @@ -12,6 +10,8 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from ' import { captureException } from '../exports'; import { SPAN_STATUS_ERROR, SPAN_STATUS_OK } from '../tracing'; import { DEBUG_BUILD } from '../debug-build'; +import { logger } from '../utils-hoist/logger'; +import { isPlainObject } from '../utils-hoist/is'; const AUTH_OPERATIONS_TO_INSTRUMENT = [ 'reauthenticate', diff --git a/packages/core/src/logs/console-integration.ts b/packages/core/src/logs/console-integration.ts index d0fe2a639738..fe1c5babefa6 100644 --- a/packages/core/src/logs/console-integration.ts +++ b/packages/core/src/logs/console-integration.ts @@ -3,7 +3,10 @@ import { DEBUG_BUILD } from '../debug-build'; import { defineIntegration } from '../integration'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes'; import type { ConsoleLevel, IntegrationFn } from '../types-hoist'; -import { CONSOLE_LEVELS, GLOBAL_OBJ, addConsoleInstrumentationHandler, logger, safeJoin } from '../utils-hoist'; +import { CONSOLE_LEVELS, logger } from '../utils-hoist/logger'; +import { GLOBAL_OBJ } from '../utils-hoist/worldwide'; +import { addConsoleInstrumentationHandler } from '../utils-hoist/instrument/console'; +import { safeJoin } from '../utils-hoist/string'; import { _INTERNAL_captureLog } from './exports'; interface CaptureConsoleOptions { diff --git a/packages/core/src/logs/envelope.ts b/packages/core/src/logs/envelope.ts index 1b0a58892546..706596a60dcb 100644 --- a/packages/core/src/logs/envelope.ts +++ b/packages/core/src/logs/envelope.ts @@ -1,8 +1,7 @@ -import { createEnvelope } from '../utils-hoist'; - import type { DsnComponents, SdkMetadata, SerializedOtelLog } from '../types-hoist'; import type { OtelLogEnvelope, OtelLogItem } from '../types-hoist/envelope'; -import { dsnToString } from '../utils-hoist'; +import { dsnToString } from '../utils-hoist/dsn'; +import { createEnvelope } from '../utils-hoist/envelope'; /** * Creates OTEL log envelope item for a serialized OTEL log. diff --git a/packages/core/src/logs/exports.ts b/packages/core/src/logs/exports.ts index 4864f3b32b8e..62b37b2304f5 100644 --- a/packages/core/src/logs/exports.ts +++ b/packages/core/src/logs/exports.ts @@ -5,9 +5,10 @@ import { DEBUG_BUILD } from '../debug-build'; import { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants'; import type { SerializedLogAttribute, SerializedOtelLog } from '../types-hoist'; import type { Log } from '../types-hoist/log'; -import { isParameterizedString, logger } from '../utils-hoist'; import { _getSpanForScope } from '../utils/spanOnScope'; import { createOtelLogEnvelope } from './envelope'; +import { logger } from '../utils-hoist/logger'; +import { isParameterizedString } from '../utils-hoist/is'; const MAX_LOG_BUFFER_SIZE = 100; diff --git a/packages/core/src/mcp-server.ts b/packages/core/src/mcp-server.ts index 85e9428853e2..3290b5b674b1 100644 --- a/packages/core/src/mcp-server.ts +++ b/packages/core/src/mcp-server.ts @@ -5,7 +5,7 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, } from './semanticAttributes'; import { startSpan } from './tracing'; -import { logger } from './utils-hoist'; +import { logger } from './utils-hoist/logger'; interface MCPServerInstance { // The first arg is always a name, the last arg should always be a callback function (ie a handler). diff --git a/packages/core/src/server-runtime-client.ts b/packages/core/src/server-runtime-client.ts index b7910ed23d0a..fde0dac07cc2 100644 --- a/packages/core/src/server-runtime-client.ts +++ b/packages/core/src/server-runtime-client.ts @@ -23,7 +23,7 @@ import { logger } from './utils-hoist/logger'; import { uuid4 } from './utils-hoist/misc'; import { resolvedSyncPromise } from './utils-hoist/syncpromise'; import { _INTERNAL_flushLogsBuffer } from './logs/exports'; -import { isPrimitive } from './utils-hoist'; +import { isPrimitive } from './utils-hoist/is'; // TODO: Make this configurable const DEFAULT_LOG_FLUSH_INTERVAL = 5000; diff --git a/packages/core/src/session.ts b/packages/core/src/session.ts index a1ea29448fa4..7f5d770603a8 100644 --- a/packages/core/src/session.ts +++ b/packages/core/src/session.ts @@ -1,5 +1,6 @@ import type { SerializedSession, Session, SessionContext, SessionStatus } from './types-hoist'; -import { timestampInSeconds, uuid4 } from './utils-hoist'; +import { uuid4 } from './utils-hoist/misc'; +import { timestampInSeconds } from './utils-hoist/time'; /** * Creates a new `Session` object by setting certain default parameters. If optional @param context diff --git a/packages/core/src/trpc.ts b/packages/core/src/trpc.ts index 59f3ecbdd18b..d41030b22dd6 100644 --- a/packages/core/src/trpc.ts +++ b/packages/core/src/trpc.ts @@ -2,8 +2,8 @@ import { getClient, withScope } from './currentScopes'; import { captureException } from './exports'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes'; import { startSpanManual } from './tracing'; -import { addNonEnumerableProperty } from './utils-hoist'; import { normalize } from './utils-hoist/normalize'; +import { addNonEnumerableProperty } from './utils-hoist/object'; interface SentryTrpcMiddlewareOptions { /** Whether to include procedure inputs in reported events. Defaults to `false`. */ diff --git a/packages/core/src/utils-hoist/index.ts b/packages/core/src/utils-hoist/index.ts deleted file mode 100644 index 2bb15f1423dc..000000000000 --- a/packages/core/src/utils-hoist/index.ts +++ /dev/null @@ -1,140 +0,0 @@ -export { applyAggregateErrorsToEvent } from './aggregate-errors'; -export { getBreadcrumbLogLevelFromHttpStatusCode } from './breadcrumb-log-level'; -export { getComponentName, getLocationHref, htmlTreeAsString } from './browser'; -export { dsnFromString, dsnToString, makeDsn } from './dsn'; -// eslint-disable-next-line deprecation/deprecation -export { SentryError } from './error'; -export { GLOBAL_OBJ } from './worldwide'; -export type { InternalGlobal } from './worldwide'; -export { addConsoleInstrumentationHandler } from './instrument/console'; -export { addFetchEndInstrumentationHandler, addFetchInstrumentationHandler } from './instrument/fetch'; -export { addGlobalErrorInstrumentationHandler } from './instrument/globalError'; -export { addGlobalUnhandledRejectionInstrumentationHandler } from './instrument/globalUnhandledRejection'; -export { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers } from './instrument/handlers'; -export { - isDOMError, - isDOMException, - isElement, - isError, - isErrorEvent, - isEvent, - isInstanceOf, - isParameterizedString, - isPlainObject, - isPrimitive, - isRegExp, - isString, - isSyntheticEvent, - isThenable, - isVueViewModel, -} from './is'; -export { isBrowser } from './isBrowser'; -export { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods } from './logger'; -export type { Logger } from './logger'; - -export { - addContextToFrame, - addExceptionMechanism, - addExceptionTypeValue, - checkOrSetAlreadyCaught, - getEventDescription, - parseSemver, - uuid4, -} from './misc'; -export { isNodeEnv, loadModule } from './node'; -export { normalize, normalizeToSize, normalizeUrlToBase } from './normalize'; -export { - addNonEnumerableProperty, - convertToPlainObject, - // eslint-disable-next-line deprecation/deprecation - dropUndefinedKeys, - extractExceptionKeysForMessage, - fill, - getOriginalFunction, - markFunctionWrapped, - objectify, -} from './object'; -export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './path'; -export { makePromiseBuffer, SENTRY_BUFFER_FULL_ERROR } from './promisebuffer'; -export type { PromiseBuffer } from './promisebuffer'; - -export { severityLevelFromString } from './severity'; -export { - UNKNOWN_FUNCTION, - createStackParser, - getFramesFromEvent, - getFunctionName, - stackParserFromStackParserOptions, - stripSentryFramesAndReverse, -} from './stacktrace'; -export { filenameIsInApp, node, nodeStackLineParser } from './node-stack-trace'; -export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate } from './string'; -export { - isNativeFunction, - supportsDOMError, - supportsDOMException, - supportsErrorEvent, - supportsFetch, - supportsHistory, - supportsNativeFetch, - supportsReferrerPolicy, - supportsReportingObserver, -} from './supports'; -export { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise'; -export { browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds } from './time'; -export { - TRACEPARENT_REGEXP, - extractTraceparentData, - generateSentryTraceHeader, - propagationContextFromHeaders, -} from './tracing'; -export { getSDKSource, isBrowserBundle } from './env'; -export type { SdkSource } from './env'; -export { - addItemToEnvelope, - createAttachmentEnvelopeItem, - createEnvelope, - createEventEnvelopeHeaders, - createSpanEnvelopeItem, - envelopeContainsItemType, - envelopeItemTypeToDataCategory, - forEachEnvelopeItem, - getSdkMetadataForEnvelopeHeader, - parseEnvelope, - serializeEnvelope, -} from './envelope'; -export { createClientReportEnvelope } from './clientreport'; -export { - DEFAULT_RETRY_AFTER, - disabledUntil, - isRateLimited, - parseRetryAfterHeader, - updateRateLimits, -} from './ratelimit'; -export type { RateLimits } from './ratelimit'; -export { - MAX_BAGGAGE_STRING_LENGTH, - SENTRY_BAGGAGE_KEY_PREFIX, - SENTRY_BAGGAGE_KEY_PREFIX_REGEX, - baggageHeaderToDynamicSamplingContext, - dynamicSamplingContextToSentryBaggageHeader, - parseBaggageHeader, - objectToBaggageHeader, -} from './baggage'; - -export { - getSanitizedUrlString, - parseUrl, - stripUrlQueryAndFragment, - parseStringToURLObject, - isURLObjectRelative, - getSanitizedUrlStringFromUrlObject, -} from './url'; -export { eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames } from './eventbuilder'; -export { callFrameToStackFrame, watchdogTimer } from './anr'; -export { LRUMap } from './lru'; -export { generateTraceId, generateSpanId } from './propagationContext'; -export { vercelWaitUntil } from './vercelWaitUntil'; -export { SDK_VERSION } from './version'; -export { getDebugImagesForResources, getFilenameToDebugIdMap } from './debug-ids'; -export { escapeStringForRegex } from './vendor/escapeStringForRegex'; diff --git a/packages/core/test/lib/logs/envelope.test.ts b/packages/core/test/lib/logs/envelope.test.ts index 49bca586430c..b50ca60c9a1c 100644 --- a/packages/core/test/lib/logs/envelope.test.ts +++ b/packages/core/test/lib/logs/envelope.test.ts @@ -1,13 +1,16 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'; import { createOtelLogEnvelope, createOtelLogEnvelopeItem } from '../../../src/logs/envelope'; import type { DsnComponents, SdkMetadata, SerializedOtelLog } from '../../../src/types-hoist'; -import * as utilsHoist from '../../../src/utils-hoist'; +import * as utilsDsn from '../../../src/utils-hoist/dsn'; +import * as utilsEnvelope from '../../../src/utils-hoist/envelope'; // Mock utils-hoist functions -vi.mock('../../../src/utils-hoist', () => ({ - createEnvelope: vi.fn((_headers, items) => [_headers, items]), +vi.mock('../../../src/utils-hoist/dsn', () => ({ dsnToString: vi.fn(dsn => `https://${dsn.publicKey}@${dsn.host}/`), })); +vi.mock('../../../src/utils-hoist/envelope', () => ({ + createEnvelope: vi.fn((_headers, items) => [_headers, items]), +})); describe('createOtelLogEnvelopeItem', () => { it('creates an envelope item with correct structure', () => { @@ -32,8 +35,8 @@ describe('createOtelLogEnvelope', () => { vi.setSystemTime(new Date('2023-01-01T12:00:00Z')); // Reset mocks - vi.mocked(utilsHoist.createEnvelope).mockClear(); - vi.mocked(utilsHoist.dsnToString).mockClear(); + vi.mocked(utilsEnvelope.createEnvelope).mockClear(); + vi.mocked(utilsDsn.dsnToString).mockClear(); }); afterEach(() => { @@ -53,7 +56,7 @@ describe('createOtelLogEnvelope', () => { expect(result[0]).toEqual({}); // Verify createEnvelope was called with the right parameters - expect(utilsHoist.createEnvelope).toHaveBeenCalledWith({}, expect.any(Array)); + expect(utilsEnvelope.createEnvelope).toHaveBeenCalledWith({}, expect.any(Array)); }); it('includes SDK info when metadata is provided', () => { @@ -101,7 +104,7 @@ describe('createOtelLogEnvelope', () => { const result = createOtelLogEnvelope(mockLogs, undefined, 'https://tunnel.example.com', dsn); expect(result[0]).toHaveProperty('dsn'); - expect(utilsHoist.dsnToString).toHaveBeenCalledWith(dsn); + expect(utilsDsn.dsnToString).toHaveBeenCalledWith(dsn); }); it('maps each log to an envelope item', () => { @@ -119,7 +122,7 @@ describe('createOtelLogEnvelope', () => { createOtelLogEnvelope(mockLogs); // Check that createEnvelope was called with an array of envelope items - expect(utilsHoist.createEnvelope).toHaveBeenCalledWith( + expect(utilsEnvelope.createEnvelope).toHaveBeenCalledWith( expect.anything(), expect.arrayContaining([ expect.arrayContaining([{ type: 'otel_log' }, mockLogs[0]]), @@ -166,7 +169,7 @@ describe('Trace context in logs', () => { createOtelLogEnvelope([mockLog]); // Verify the envelope preserves the trace information - expect(utilsHoist.createEnvelope).toHaveBeenCalledWith( + expect(utilsEnvelope.createEnvelope).toHaveBeenCalledWith( expect.anything(), expect.arrayContaining([ expect.arrayContaining([