Skip to content

Commit ea6872a

Browse files
committed
Fix
1 parent 44324cc commit ea6872a

File tree

8 files changed

+47
-65
lines changed

8 files changed

+47
-65
lines changed

dev-packages/opentelemetry-v2-tests/test/integration/transactions.test.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -548,57 +548,57 @@ describe('Integration | Transactions', () => {
548548
expect(finishedSpans.length).toBe(0);
549549
});
550550

551-
it('collects child spans that are finished within 5 minutes their parent span has been sent', async () => {
552-
const timeout = 5 * 60 * 1000;
553-
const now = Date.now();
554-
vi.useFakeTimers();
555-
vi.setSystemTime(now);
551+
it('collects child spans that are finished within 5 minutes their parent span has been sent', async () => {
552+
const timeout = 5 * 60 * 1000;
553+
const now = Date.now();
554+
vi.useFakeTimers();
555+
vi.setSystemTime(now);
556556

557-
const logs: unknown[] = [];
558-
vi.spyOn(logger, 'log').mockImplementation(msg => logs.push(msg));
557+
const logs: unknown[] = [];
558+
vi.spyOn(logger, 'log').mockImplementation(msg => logs.push(msg));
559559

560-
const transactions: Event[] = [];
560+
const transactions: Event[] = [];
561561

562-
mockSdkInit({
563-
tracesSampleRate: 1,
564-
beforeSendTransaction: event => {
565-
transactions.push(event);
566-
return null;
567-
},
568-
});
562+
mockSdkInit({
563+
tracesSampleRate: 1,
564+
beforeSendTransaction: event => {
565+
transactions.push(event);
566+
return null;
567+
},
568+
});
569569

570-
const provider = getProvider();
571-
const spanProcessor = getSpanProcessor();
570+
const provider = getProvider();
571+
const spanProcessor = getSpanProcessor();
572572

573-
const exporter = spanProcessor ? spanProcessor['_exporter'] : undefined;
573+
const exporter = spanProcessor ? spanProcessor['_exporter'] : undefined;
574574

575-
if (!exporter) {
576-
throw new Error('No exporter found, aborting test...');
577-
}
575+
if (!exporter) {
576+
throw new Error('No exporter found, aborting test...');
577+
}
578578

579-
startSpanManual({ name: 'test name' }, async span => {
580-
const subSpan = startInactiveSpan({ name: 'inner span 1' });
581-
subSpan.end();
579+
startSpanManual({ name: 'test name' }, async span => {
580+
const subSpan = startInactiveSpan({ name: 'inner span 1' });
581+
subSpan.end();
582582

583-
const subSpan2 = startInactiveSpan({ name: 'inner span 2' });
583+
const subSpan2 = startInactiveSpan({ name: 'inner span 2' });
584584

585-
span.end();
585+
span.end();
586586

587-
setTimeout(() => {
588-
subSpan2.end();
589-
}, timeout - 2);
590-
});
587+
setTimeout(() => {
588+
subSpan2.end();
589+
}, timeout - 2);
590+
});
591591

592-
vi.advanceTimersByTime(timeout - 1);
592+
vi.advanceTimersByTime(timeout - 1);
593593

594-
expect(transactions).toHaveLength(2);
595-
expect(transactions[0]?.spans).toHaveLength(1);
594+
expect(transactions).toHaveLength(2);
595+
expect(transactions[0]?.spans).toHaveLength(1);
596596

597-
const finishedSpans: any = exporter['_finishedSpanBuckets'].flatMap(bucket =>
598-
bucket ? Array.from(bucket.spans) : [],
599-
);
600-
expect(finishedSpans.length).toBe(0);
601-
});
597+
const finishedSpans: any = exporter['_finishedSpanBuckets'].flatMap(bucket =>
598+
bucket ? Array.from(bucket.spans) : [],
599+
);
600+
expect(finishedSpans.length).toBe(0);
601+
});
602602

603603
it('discards child spans that are finished after 5 minutes their parent span has been sent', async () => {
604604
const timeout = 5 * 60 * 1000;

packages/browser/src/integrations/featureFlags/featureFlagsIntegration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Client, Event, EventHint, Integration, IntegrationFn, Span } from '@sentry/core';
1+
import type { Client, Event, EventHint, Integration, IntegrationFn } from '@sentry/core';
22
import { defineIntegration } from '@sentry/core';
33
import { addFeatureFlagToActiveSpan, copyFlagsFromScopeToEvent, insertFlagToScope } from '../../utils/featureFlags';
44

packages/browser/src/integrations/featureFlags/launchdarkly/integration.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import type { Client, Event, EventHint, IntegrationFn, Span } from '@sentry/core';
1+
import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';
22
import { defineIntegration } from '@sentry/core';
3-
import {
4-
addFeatureFlagToActiveSpan,
5-
copyFlagsFromScopeToEvent,
6-
insertFlagToScope,
7-
} from '../../../utils/featureFlags';
3+
import { addFeatureFlagToActiveSpan, copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
84
import type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';
95

106
/**

packages/browser/src/integrations/featureFlags/openfeature/integration.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
* OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());
1414
* ```
1515
*/
16-
import type { Client, Event, EventHint, IntegrationFn, Span } from '@sentry/core';
16+
import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';
1717
import { defineIntegration } from '@sentry/core';
18-
import {
19-
addFeatureFlagToActiveSpan,
20-
copyFlagsFromScopeToEvent,
21-
insertFlagToScope,
22-
} from '../../../utils/featureFlags';
18+
import { addFeatureFlagToActiveSpan, copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
2319
import type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';
2420

2521
export const openFeatureIntegration = defineIntegration(() => {

packages/browser/src/integrations/featureFlags/statsig/integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Client, Event, EventHint, IntegrationFn, Span } from '@sentry/core';
1+
import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';
22
import { defineIntegration } from '@sentry/core';
33
import { addFeatureFlagToActiveSpan, copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
44
import type { FeatureGate, StatsigClient } from './types';

packages/browser/src/integrations/featureFlags/unleash/integration.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import type { Client, Event, EventHint, IntegrationFn, Span } from '@sentry/core';
1+
import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';
22
import { defineIntegration, fill, logger } from '@sentry/core';
33
import { DEBUG_BUILD } from '../../../debug-build';
4-
import {
5-
addFeatureFlagToActiveSpan,
6-
copyFlagsFromScopeToEvent,
7-
insertFlagToScope,
8-
} from '../../../utils/featureFlags';
4+
import { addFeatureFlagToActiveSpan, copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
95
import type { UnleashClient, UnleashClientClass } from './types';
106

117
type UnleashIntegrationOptions = {

packages/browser/src/utils/featureFlags.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,7 @@ export function insertFlagToScope(name: string, value: unknown, maxSize: number
7474
* @param value Value of the feature flag.
7575
* @param maxSize Max number of flags the buffer should store. Default value should always be used in production.
7676
*/
77-
export function insertToFlagBuffer(
78-
flags: FeatureFlag[],
79-
name: string,
80-
value: unknown,
81-
maxSize: number,
82-
): void {
77+
export function insertToFlagBuffer(flags: FeatureFlag[], name: string, value: unknown, maxSize: number): void {
8378
if (typeof value !== 'boolean') {
8479
return;
8580
}

packages/core/src/utils-hoist/worldwide.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import type { Carrier } from '../carrier';
1616
import type { Client } from '../client';
17-
import type { FeatureFlag } from '../featureFlags';
1817
import type { SerializedLog } from '../types-hoist/log';
1918
import type { Span } from '../types-hoist/span';
2019
import type { SdkSource } from './env';

0 commit comments

Comments
 (0)