Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest("Feature flags are added to active span's attributes on span end.", async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeatureFlagsTest() || shouldSkipTracingTest()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('GrowthBook onError: basic eviction/update and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest(
"GrowthBook onSpan: flags are added to active span's attributes on span end",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest("Feature flags are added to active span's attributes on span end.", async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeatureFlagsTest() || shouldSkipTracingTest()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Flag evaluation error hook', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest("Feature flags are added to active span's attributes on span end.", async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeatureFlagsTest() || shouldSkipTracingTest()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest("Feature flags are added to active span's attributes on span end.", async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeatureFlagsTest() || shouldSkipTracingTest()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expect } from '@playwright/test';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { sentryTest } from '../../../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipFeatureFlagsTest,
waitForErrorRequest,
FLAG_BUFFER_SIZE,
} from '../../../../../../utils/helpers';

sentryTest('Basic test with eviction, update, and no async tasks', async ({ getLocalTestUrl, page }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from '@playwright/test';
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { waitForStreamedSpan } from '../../../../../utils/spanUtils';
import { sentryTest } from '../../../../../utils/fixtures';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest } from '../../../../../utils/helpers';
import { shouldSkipFeatureFlagsTest, shouldSkipTracingTest, MAX_FLAGS_PER_SPAN } from '../../../../../utils/helpers';

sentryTest("Feature flags are added to active span's attributes on span end.", async ({ getLocalTestUrl, page }) => {
if (shouldSkipFeatureFlagsTest() || shouldSkipTracingTest()) {
Expand Down
6 changes: 6 additions & 0 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import type {
} from '@sentry/core';
import { parseEnvelope } from '@sentry/core';

/**
* Mirror the feature flag limits in `@sentry/core`.
*/
export const FLAG_BUFFER_SIZE = 100;
export const MAX_FLAGS_PER_SPAN = 10;

export const envelopeUrlRegex = /\.sentry\.io\/api\/\d+\/envelope\//;

export const envelopeParser = (request: Request | null): unknown[] => {
Expand Down
6 changes: 6 additions & 0 deletions dev-packages/node-integration-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export * from './mocks/anthropic';
export * from './mocks/google';
export * from './mocks/openai';

/**
* Mirror the feature flag limits in `@sentry/core`.
*/
export const FLAG_BUFFER_SIZE = 100;
export const MAX_FLAGS_PER_SPAN = 10;

/**
* Debug logging transport
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import * as Sentry from '@sentry/node';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
import { loggingTransport, FLAG_BUFFER_SIZE } from '@sentry-internal/node-integration-tests';

Sentry.init({
traceLifecycle: 'static',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { afterAll, test } from 'vitest';
import { FLAG_BUFFER_SIZE } from '@sentry-internal/node-integration-tests';
import { cleanupChildProcesses, createRunner } from '../../../../../utils/runner';

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import * as Sentry from '@sentry/node';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
import { loggingTransport, MAX_FLAGS_PER_SPAN } from '@sentry-internal/node-integration-tests';

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { _INTERNAL_MAX_FLAGS_PER_SPAN as MAX_FLAGS_PER_SPAN } from '@sentry/core';
import { afterAll, expect, test } from 'vitest';
import { MAX_FLAGS_PER_SPAN } from '@sentry-internal/node-integration-tests';
import { cleanupChildProcesses, createRunner } from '../../../../utils/runner';

afterAll(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { ClientOptions, UserContext } from '@growthbook/growthbook';
import { GrowthBookClient } from '@growthbook/growthbook';
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import * as Sentry from '@sentry/node';
import { loggingTransport } from '@sentry-internal/node-integration-tests';
import { loggingTransport, FLAG_BUFFER_SIZE } from '@sentry-internal/node-integration-tests';

// Wrapper class to instantiate GrowthBookClient
class GrowthBookWrapper {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { _INTERNAL_FLAG_BUFFER_SIZE as FLAG_BUFFER_SIZE } from '@sentry/core';
import { afterAll, test } from 'vitest';
import { FLAG_BUFFER_SIZE } from '@sentry-internal/node-integration-tests';
import { cleanupChildProcesses, createRunner } from '../../../../../utils/runner';

afterAll(() => {
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export {
getSpanDescendants,
getStatusMessage,
getRootSpan,
INTERNAL_getSegmentSpan,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no action required: I think the longterm plan should be to replace getRootSpan with getSegmentSpan. The INTERNAL_ prefix in this case was used to discourage users from using that API because in a streaming world, users shouldn't have to care about the segment span of a span. Not sure if this has aged well enough to keep that strong discouragement, so maybe a getSegmentSpan API is generally fine to have in v12.

getActiveSpan,
addChildSpanToSpan,
spanTimeInputToSeconds,
Expand Down Expand Up @@ -187,14 +186,10 @@ export { profiler } from './profiling';
export { instrumentFetchRequest, _INTERNAL_getTracingHeadersForFetchRequest } from './fetch';
export { captureFeedback } from './feedback';
export type { ReportDialogOptions } from './report-dialog';
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer, _INTERNAL_captureSerializedLog } from './logs/internal';
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/internal';
export { logger } from './logs/public-api';
export { consoleLoggingIntegration } from './logs/console-integration';
export {
_INTERNAL_captureMetric,
_INTERNAL_flushMetricsBuffer,
_INTERNAL_captureSerializedMetric,
} from './metrics/internal';
export { _INTERNAL_flushMetricsBuffer } from './metrics/internal';
export { metrics } from './metrics/public-api';
export type { MetricOptions } from './metrics/public-api';
export { createConsolaReporter } from './integrations/consola';
Expand All @@ -205,8 +200,6 @@ export {
_INTERNAL_copyFlagsFromScopeToEvent,
_INTERNAL_insertFlagToScope,
_INTERNAL_addFeatureFlagToActiveSpan,
_INTERNAL_FLAG_BUFFER_SIZE,
_INTERNAL_MAX_FLAGS_PER_SPAN,
} from './utils/featureFlags';
export { applyAggregateErrorsToEvent } from './utils/aggregate-errors';
export { getBreadcrumbLogLevelFromHttpStatusCode } from './utils/breadcrumb-log-level';
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export { ServerRuntimeClient } from './server-runtime-client';
export type { TunnelRequestLike } from './utils/tunnel';
export {
getServedTunnel as _INTERNAL_getServedTunnel,
getTunnelPaths as _INTERNAL_getTunnelPaths,
handleServedTunnelRequest as _INTERNAL_handleServedTunnelRequest,
isServedTunnelRequest as _INTERNAL_isServedTunnelRequest,
isTunnelRequest,
Expand Down
Loading