Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-10.67.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-10.67.0.tgz",
"@sentry/server-utils": "file:../../../../packages/server-utils/sentry-server-utils-10.67.0.tgz",
"sentry": "file:../sentry-stub"
}
}
Expand Down
9 changes: 9 additions & 0 deletions dev-packages/bundler-plugin-integration-tests/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ execSync('yarn build:dev:filter @sentry/core', { cwd: repoRoot, stdio: 'inherit'
console.log('Packing @sentry/core...');
execSync('yarn build:tarball', { cwd: coreDir, stdio: 'inherit' });

// `@sentry/bundler-plugins` externalizes `@sentry/server-utils` (it `require`s it at build time), so
// the fixtures need the local tarball to match the local `@sentry/core` build above — otherwise pnpm
// pulls a mismatched published version from the registry.
const serverUtilsDir = join(repoRoot, 'packages', 'server-utils');
console.log('Building @sentry/server-utils and its workspace dependencies...');
execSync('yarn build:dev:filter @sentry/server-utils', { cwd: repoRoot, stdio: 'inherit' });
console.log('Packing @sentry/server-utils...');
execSync('yarn build:tarball', { cwd: serverUtilsDir, stdio: 'inherit' });

console.log('Building @sentry/bundler-plugins and its workspace dependencies...');
execSync('yarn build:dev:filter @sentry/bundler-plugins', { cwd: repoRoot, stdio: 'inherit' });
console.log('Packing @sentry/bundler-plugins...');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// `DenoClient.init()` installs that strategy on the direct-construction path.
// Without it, the subscriber never binds and no span is produced.
import { createStackParser } from '@sentry/core';
import { nodeStackLineParser } from '@sentry/core/server';
import { nodeStackLineParser } from '@sentry/server-utils';
import { DenoClient, getCurrentScope, getDefaultIntegrations, startSpan } from '@sentry/deno';
import { tracingChannel } from 'node:diagnostics_channel';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Context } from '@sentry/core';
import { flushIfServerless } from '@sentry/core/server';
import * as SentryNode from '@sentry/node';
import { H3Error } from 'h3';
import type { CapturedErrorContext } from 'nitropack';
Expand Down Expand Up @@ -32,7 +31,7 @@ export default defineNitroPlugin(nitroApp => {
mechanism: { handled: false },
});

await flushIfServerless();
await SentryNode.flush();
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
filterCollectedUrl,
filterCollectedUrlQuery,
} from '@sentry/core';
import { flushIfServerless } from '@sentry/core/server';
import { flushIfServerless } from '@sentry/server-utils';
import {
captureException,
continueTrace,
Expand Down
4 changes: 2 additions & 2 deletions packages/bun/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ServerRuntimeClientOptions } from '@sentry/core/server';
import { ServerRuntimeClient } from '@sentry/core/server';
import type { ServerRuntimeClientOptions } from '@sentry/server-utils';
import { ServerRuntimeClient } from '@sentry/server-utils';
import { applySdkMetadata } from '@sentry/core';
import * as os from 'os';
import type { BunClientOptions } from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/bun/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BaseTransportOptions, ClientOptions, Options } from '@sentry/core';
import type { ServerRuntimeOptions } from '@sentry/core/server';
import type { ServerRuntimeOptions } from '@sentry/server-utils';

/**
* Base options for the Sentry Bun SDK.
Expand Down
1 change: 1 addition & 0 deletions packages/bundler-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"dependencies": {
"@babel/core": "^7.18.5",
"@sentry/core": "10.67.0",
"@sentry/server-utils": "10.67.0",
"dotenv": "^17.4.2",
"find-up": "^5.0.0",
"glob": "^13.0.6",
Expand Down
6 changes: 3 additions & 3 deletions packages/bundler-plugins/src/core/sentry/telemetry.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Client } from '@sentry/core';
import type { ServerRuntimeClientOptions } from '@sentry/core/server';
import type { ServerRuntimeClientOptions } from '@sentry/server-utils';
import { applySdkMetadata } from '@sentry/core';
import { ServerRuntimeClient } from '@sentry/core/server';
import { ServerRuntimeClient } from '@sentry/server-utils';
import type { NormalizedOptions } from '../options-mapping';
import { SENTRY_SAAS_URL } from '../options-mapping';
import { Scope } from '@sentry/core';
import { createStackParser } from '@sentry/core';
import { nodeStackLineParser } from '@sentry/core/server';
import { nodeStackLineParser } from '@sentry/server-utils';
import { makeOptionallyEnabledNodeTransport } from './transports';
import { SentryCliAdapter } from '../cli';
import { LIB_VERSION } from '../version';
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
debug,
spanIsSampled,
} from '@sentry/core';
import type { ServerRuntimeClientOptions } from '@sentry/core/server';
import { ServerRuntimeClient } from '@sentry/core/server';
import type { ServerRuntimeClientOptions } from '@sentry/server-utils/no-diagnostic-channels';
import { ServerRuntimeClient } from '@sentry/server-utils/no-diagnostic-channels';
import { DEBUG_BUILD } from './debug-build';
import type { ExecutionContextCompat } from './executionContext';
import type { makeFlushLock } from './flush';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/durableobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { RPC } from '@sentry/conventions/op';
import { isObjectLike } from '@sentry/core';
import type { DurableObject } from 'cloudflare:workers';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import type { CloudflareOptions } from './client';
import { getInstrumented, markAsInstrumented } from './instrument';
import { instrumentDurableObjectHandlers } from './instrumentations/instrumentDurableObjectHandlers';
Expand Down
5 changes: 3 additions & 2 deletions packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ export {
withStreamedSpan,
spanStreamingIntegration,
} from '@sentry/core';
export { instrumentPostgresJsSql, trpcMiddleware, wrapMcpServerWithSentry } from '@sentry/core/server';
export { instrumentPostgresJsSql, wrapMcpServerWithSentry } from '@sentry/core/server';
export { trpcMiddleware } from '@sentry/server-utils';

export { withSentry } from './withSentry';
export { defineCloudflareOptions } from './defineCloudflareOptions';
Expand Down Expand Up @@ -136,4 +137,4 @@ export {

export { instrumentWorkflowWithSentry } from './workflows';

export { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
export { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RpcStub, WorkerEntrypoint } from 'cloudflare:workers';
import { RPC } from '@sentry/conventions/op';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import type { CloudflareOptions } from '../client';
import { getFinalOptions } from '../options';
import type { DefaultEnv, ResolveEnv, StrictCloudflareOptions } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/pages-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import type { CloudflareOptions } from './client';
import type { ExecutionContextCompat } from './executionContext';
import { wrapRequestHandlerWithInit } from './wrapRequestHandlerWithInit';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/vendor/stacktrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import type { StackLineParser, StackLineParserFn, StackParser } from '@sentry/core';
import { basename, createStackParser } from '@sentry/core';
import { nodeStackLineParser } from '@sentry/core/server';
import { nodeStackLineParser } from '@sentry/server-utils/no-diagnostic-channels';

type GetModuleFn = (filename: string | undefined) => string | undefined;

Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/withSentry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { instrumentExportedHandlerEmail } from './instrumentations/worker/instrumentEmail';
import { instrumentExportedHandlerFetch } from './instrumentations/worker/instrumentFetch';
import { instrumentExportedHandlerQueue } from './instrumentations/worker/instrumentQueue';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/src/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
WorkflowStepRollbackOptions,
WorkflowTimeoutDuration,
} from 'cloudflare:workers';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import type { CloudflareOptions } from './client';
import { flushAndDispose, getOriginalWaitUntil } from './flush';
import { instrumentEnv } from './instrumentations/worker/instrumentEnv';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { CloudflareClient, type CloudflareClientOptions } from '../src/client';
import { makeFlushLock } from '../src/flush';
import { getInvocationState } from '../src/utils/invocationContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
startSpan,
} from '@sentry/core';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { CloudflareClient, type CloudflareClientOptions } from '../src/client';
import { withStaticSpan } from '../src/index';
import { instrumentCloudflareAgent } from '../src/instrumentations/agents';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('instrumentWorkerEntrypoint', () => {
});

it('Calls setAsyncLocalStorageAsyncContextStrategy outside Proxy (at instrumentation time), not inside construct', async () => {
const asyncModule = await import('@sentry/server-utils/no-diagnostic-channels');
const asyncModule = await import('@sentry/server-utils/async-context');
const setStrategy = vi.spyOn(asyncModule, 'setAsyncLocalStorageAsyncContextStrategy');
const mockContext = createMockExecutionContext();
const TestClass = class extends WorkerEntrypoint {
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/opentelemetry.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { trace } from '@opentelemetry/api';
import type { TransactionEvent } from '@sentry/core';
import { getActiveSpan, spanToJSON, startSpan } from '@sentry/core';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { beforeEach, describe, expect, test, vi } from 'vitest';
import type { CloudflareOptions } from '../src/client';
import { wrapRequestHandler } from '../src/request';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ExecutionContext } from '@cloudflare/workers-types';
import type { Event } from '@sentry/core';
import * as SentryCore from '@sentry/core';
import { beforeAll, beforeEach, describe, expect, onTestFinished, test, vi } from 'vitest';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import type { CloudflareOptions } from '../src/client';
import { CloudflareClient } from '../src/client';
import { httpServerIntegration } from '../src/integrations/httpServer';
Expand Down
13 changes: 11 additions & 2 deletions packages/cloudflare/test/requestModuleGraph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,17 @@ describe('module graph of `wrapRequestHandler`', () => {

it('contains no package that depends on Node.js APIs', () => {
// `@sentry/server-utils` subscribes to `node:diagnostics_channel` and `@sentry/node` needs Node.js
// throughout. Both are only allowed in `sdk.ts`, `index.ts` and `vite/` (see `.oxlintrc.json`).
expect(externals.filter(specifier => /^@sentry\/(node|server-utils)(\/|$)/.test(specifier))).toEqual([]);
// throughout. The `@sentry/server-utils/no-diagnostic-channels` entry is the edge-safe subset
// (it carries `ServerRuntimeClient` and the node stack parser without the channel subscription), so
// it is the one exception the request-handler graph may reach.
expect(
externals.filter(
specifier =>
/^@sentry\/node(\/|$)/.test(specifier) ||
(/^@sentry\/server-utils(\/|$)/.test(specifier) &&
specifier !== '@sentry/server-utils/no-diagnostic-channels'),
),
).toEqual([]);
});

it('does not reach `async.ts`, the only shipped module importing `node:async_hooks`', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/utils/invocationContext.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { debug, getDefaultIsolationScope, getIsolationScope, GLOBAL_OBJ, withIsolationScope } from '@sentry/core';
import { AsyncLocalStorage } from 'async_hooks';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { getInvocationState, getInvocationWaitUntil, setInvocationState } from '../../src/utils/invocationContext';
import { withInvocationIsolationScope } from '../../src/utils/invocationScope';
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/test/utils/invocationScope.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getIsolationScope, getMainCarrier, GLOBAL_OBJ, type Scope, setAsyncContextStrategy } from '@sentry/core';
import { AsyncLocalStorage } from 'async_hooks';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';
import { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/async-context';
import { beforeEach, describe, expect, it } from 'vitest';
import { withInvocationIsolationScope } from '../../src/utils/invocationScope';

Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint, SENTRY_
export { Client } from './client';
export { initAndBind, setCurrentClient } from './sdk';
export { createTransport } from './transports/base';
export { addUserAgentToTransportHeaders } from './transports/userAgent';
export { makeOfflineTransport } from './transports/offline';
export { makeMultiplexedTransport, MULTIPLEXED_TRANSPORT_EXTRA_KEY } from './transports/multiplexed';
export {
Expand Down Expand Up @@ -118,6 +119,7 @@ export {
INTERNAL_setSegmentNameSourceIfSegment,
} from './utils/spanUtils';
export { _setSpanForScope as _INTERNAL_setSpanForScope } from './utils/spanOnScope';
export { getTraceInfoFromScope } from './utils/trace-info';
export { parseSampleRate } from './utils/parseSampleRate';
export { applySdkMetadata } from './utils/sdkMetadata';
export { getTraceData } from './utils/traceData';
Expand Down Expand Up @@ -260,6 +262,7 @@ export {
createStackParser,
getFramesFromEvent,
getFunctionName,
normalizeStackTracePath,
stackParserFromStackParserOptions,
stripSentryFramesAndReverse,
} from './utils/stacktrace';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/logs/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getCombinedScopeData } from '../utils/scopeData';
import { getActiveSpan } from '../utils/spanUtils';
import { timestampInSeconds } from '../utils/time';
import { getSequenceAttribute } from '../utils/timestampSequence';
import { _getTraceInfoFromScope } from '../utils/trace-info';
import { getTraceInfoFromScope } from '../utils/trace-info';
import { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants';
import { createLogEnvelope } from './envelope';

Expand Down Expand Up @@ -87,7 +87,7 @@ export function _INTERNAL_captureLog(

const { release, environment, beforeSendLog } = client.getOptions();

const [, traceContext] = _getTraceInfoFromScope(client, currentScope);
const [, traceContext] = getTraceInfoFromScope(client, currentScope);

const processedLogAttributes = {
...beforeLog.attributes,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/metrics/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getCombinedScopeData } from '../utils/scopeData';
import { getActiveSpan } from '../utils/spanUtils';
import { timestampInSeconds } from '../utils/time';
import { getSequenceAttribute } from '../utils/timestampSequence';
import { _getTraceInfoFromScope } from '../utils/trace-info';
import { getTraceInfoFromScope } from '../utils/trace-info';
import { createMetricEnvelope } from './envelope';

const MAX_METRIC_BUFFER_SIZE = 1000;
Expand Down Expand Up @@ -132,7 +132,7 @@ function _buildSerializedMetric(
scopeAttributes: RawAttributes<Record<string, unknown>>,
): SerializedMetric {
// Get trace context
const [, traceContext] = _getTraceInfoFromScope(client, currentScope);
const [, traceContext] = getTraceInfoFromScope(client, currentScope);
const span = getActiveSpan(currentScope);
const traceId = span ? span.spanContext().traceId : traceContext?.trace_id;
const spanId = span ? span.spanContext().spanId : undefined;
Expand Down
Loading
Loading