Skip to content

Commit a912ccd

Browse files
committed
format
1 parent 770fd4c commit a912ccd

File tree

5 files changed

+13
-45
lines changed

5 files changed

+13
-45
lines changed

.oxlintrc.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
"categories": {},
1111
"rules": {
1212
"no-unused-vars": [
13-
"warn",
14-
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }
13+
"error",
14+
{
15+
"argsIgnorePattern": "^_",
16+
"varsIgnorePattern": "^_",
17+
"caughtErrorsIgnorePattern": "^_"
18+
}
1519
],
1620

1721
// === Base rules from eslint-config-sdk/base.js ===

packages/aws-serverless/src/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ function shouldDisableLayerExtensionForProxy(): boolean {
4949
*/
5050
// NOTE: in awslambda-auto.ts, we also call the original `getDefaultIntegrations` from `@sentry/node` to load performance integrations.
5151
// If at some point we need to filter a node integration out for good, we need to make sure to also filter it out there.
52-
export function getDefaultIntegrations(_options: Options): Integration[] {
53-
return [...getDefaultIntegrationsWithoutPerformance(), awsIntegration(), awsLambdaIntegration()];
52+
export function getDefaultIntegrations(options: Options): Integration[] {
53+
return [...getDefaultIntegrationsWithoutPerformance(options), awsIntegration(), awsLambdaIntegration()];
5454
}
5555

5656
export interface AwsServerlessOptions extends NodeOptions {

packages/browser/test/integrations/spanstreaming.test.ts

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
import * as SentryCore from '@sentry/core';
2-
import {
3-
captureSpan,
4-
debug,
5-
hasSpanStreamingEnabled,
6-
isStreamedBeforeSendSpanCallback,
7-
spanIsSampled,
8-
} from '@sentry/core';
9-
import type { Span } from '@sentry/core';
2+
import { debug } from '@sentry/core';
103
import { beforeEach, describe, expect, it, vi } from 'vitest';
114
import { BrowserClient, spanStreamingIntegration } from '../../src';
125
import { getDefaultBrowserClientOptions } from '../helper/browser-client-options';
@@ -27,35 +20,6 @@ vi.mock('@sentry/core', async () => {
2720
return {
2821
...original,
2922
SpanBuffer: MockSpanBuffer,
30-
setupSpanStreaming: vi.fn((client: any) => {
31-
const initialMessage = 'SpanStreaming integration requires';
32-
const fallbackMsg = 'Falling back to static trace lifecycle.';
33-
34-
if (!(original as any).hasSpanStreamingEnabled(client)) {
35-
(original as any).debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
36-
return undefined;
37-
}
38-
39-
const beforeSendSpan = client.getOptions().beforeSendSpan;
40-
if (beforeSendSpan && !(original as any).isStreamedBeforeSendSpanCallback(beforeSendSpan)) {
41-
client.getOptions().traceLifecycle = 'static';
42-
(original as any).debug.warn(
43-
`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`,
44-
);
45-
return undefined;
46-
}
47-
48-
const buffer = new MockSpanBuffer(client);
49-
50-
client.on('afterSpanEnd', (span: Readonly<Span>) => {
51-
if (!(original as any).spanIsSampled(span)) {
52-
return;
53-
}
54-
buffer.add((original as any).captureSpan(span, client));
55-
});
56-
57-
return buffer;
58-
}),
5923
};
6024
});
6125

@@ -113,7 +77,7 @@ describe('spanStreamingIntegration', () => {
11377
dsn: 'https://username@domain/123',
11478
integrations: [spanStreamingIntegration()],
11579
traceLifecycle: 'stream',
116-
beforeSendSpan: (span: Span) => span,
80+
beforeSendSpan: (span: SentryCore.SpanJSON) => span,
11781
});
11882

11983
SentryCore.setCurrentClient(client);

packages/google-cloud-serverless/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function getCjsOnlyIntegrations(): Integration[] {
1616
}
1717

1818
/** Get the default integrations for the GCP SDK. */
19-
export function getDefaultIntegrations(_options: Options): Integration[] {
20-
return [...getDefaultIntegrationsWithoutPerformance(), ...getCjsOnlyIntegrations()];
19+
export function getDefaultIntegrations(options?: Options): Integration[] {
20+
return [...getDefaultIntegrationsWithoutPerformance(options), ...getCjsOnlyIntegrations()];
2121
}
2222

2323
/**

packages/node/src/sdk/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { initOpenTelemetry } from './initOtel';
1515
/**
1616
* Get default integrations, excluding performance.
1717
*/
18-
export function getDefaultIntegrationsWithoutPerformance(options: Options): Integration[] {
18+
export function getDefaultIntegrationsWithoutPerformance(options?: Options | undefined): Integration[] {
1919
const nodeCoreIntegrations = getNodeCoreDefaultIntegrations(options);
2020

2121
// Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions

0 commit comments

Comments
 (0)