Skip to content

Commit fac7352

Browse files
committed
polish(shared/sentry): Fix duplicate typedef for SentryConfigOpts
1 parent 35d84e0 commit fac7352

11 files changed

Lines changed: 17 additions & 12 deletions

File tree

libs/shared/sentry-utils/src/lib/models/sentry-config-opts.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export type SentryConfigOpts = {
2929

3030
/** The tracing sample rate. Setting this above 0 will aso result in performance metrics being captured. */
3131
tracesSampleRate?: number;
32+
33+
/** A function that determines the sample rate for a given event. Setting this will override tracesSampleRate. */
34+
tracesSampler?: (context: { name?: string }) => number;
35+
36+
/** A list of errors to ignore. Can be strings, regexes, or functions that take an error and return a boolean. */
37+
ignoreErrors?: Array<string | RegExp>;
3238
};
3339
};
3440

libs/shared/sentry/src/lib/browser.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import 'jsdom-global/register';
55
import * as Sentry from '@sentry/browser';
66
import * as sentryWrapper from './browser';
7-
import { SentryConfigOpts } from './models/SentryConfigOpts';
7+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
88

99
jest.mock('@sentry/browser', () => {
1010
const actual = jest.requireActual('@sentry/browser');

libs/shared/sentry/src/lib/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
import * as Sentry from '@sentry/browser';
6-
import { SentryConfigOpts } from './models/SentryConfigOpts';
6+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
77
import { tagFxaName } from './reporting';
88
import { buildSentryConfig } from './config-builder';
99
import { Logger } from './sentry.types';

libs/shared/sentry/src/lib/config-builder.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
import { buildSentryConfig } from './config-builder';
5-
import { SentryConfigOpts } from './models/SentryConfigOpts';
5+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
66
import { Logger } from './sentry.types';
77

88
describe('config-builder', () => {

libs/shared/sentry/src/lib/config-builder.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
import { Logger } from './sentry.types';
5-
import { SentryConfigOpts } from './models/SentryConfigOpts';
5+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
66

77
const sentryEnvMap: Record<string, string> = {
88
test: 'test',
@@ -37,7 +37,6 @@ export function buildSentryConfig(config: SentryConfigOpts, log: Logger) {
3737
fxaName: config.sentry?.clientName || config.sentry?.serverName,
3838
tracesSampleRate: config.sentry?.tracesSampleRate,
3939
ignoreErrors: config.sentry?.ignoreErrors || [],
40-
sendDefaultPii: config.sentry?.sendDefaultPii ?? true,
4140
};
4241

4342
return opts;

libs/shared/sentry/src/lib/next/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
88

99
import * as Sentry from '@sentry/nextjs';
10-
import { SentryConfigOpts } from '../models/SentryConfigOpts';
10+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
1111
import { buildSentryConfig } from '../config-builder';
1212
import { Logger } from '../sentry.types';
1313
import { beforeSend } from '../utils/beforeSend.client';

libs/shared/sentry/src/lib/next/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as Sentry from '@sentry/nextjs';
66
import { ErrorEvent } from '@sentry/core';
7-
import { InitSentryOpts } from '../models/SentryConfigOpts';
7+
import { InitSentryOpts } from '@fxa/shared/sentry-utils';
88
import { buildSentryConfig } from '../config-builder';
99
import { Logger } from '../sentry.types';
1010
import { beforeSend } from '../utils/beforeSend.server';

libs/shared/sentry/src/lib/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import * as Sentry from '@sentry/node';
66
import { ErrorEvent } from '@sentry/core';
77
import { extraErrorDataIntegration } from '@sentry/node';
8-
import { SentryConfigOpts } from './models/SentryConfigOpts';
8+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
99
import { buildSentryConfig } from './config-builder';
1010
import { tagFxaName } from './reporting';
1111
import { Logger } from './sentry.types';

libs/shared/sentry/src/lib/utils/beforeSend.client.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import { SentryConfigOpts } from '../models/SentryConfigOpts';
5+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
66
import { beforeSend } from './beforeSend.client';
77
import * as Sentry from '@sentry/nextjs';
88

libs/shared/sentry/src/lib/utils/beforeSend.client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Change to @sentry/browser after upgrade to Sentry 8
66
import * as Sentry from '@sentry/nextjs';
7-
import { SentryConfigOpts } from '../models/SentryConfigOpts';
7+
import { SentryConfigOpts } from '@fxa/shared/sentry-utils';
88
import { tagFxaName } from './tagFxaName';
99

1010
/**

0 commit comments

Comments
 (0)