Skip to content

Commit

Permalink
Merge pull request #16537 from mozilla/bug-sentry-tracing-sample-rate…
Browse files Browse the repository at this point in the history
…-no-applied

bug(content): Fix SENTRY_TRACES_SAMPLE_RATE not being applied
  • Loading branch information
dschom authored Mar 8, 2024
2 parents bc14ad0 + e7b4d56 commit 96f6e97
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/browserid-verifier/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function loadConf() {
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-admin-panel/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-admin-server/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-auth-server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ const convictConf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
1 change: 1 addition & 0 deletions packages/fxa-content-server/server/lib/beta-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const settingsConfig = {
dsn: config.get('sentry.dsn'),
env: config.get('sentry.env'),
sampleRate: config.get('sentry.sampleRate'),
tracesSampleRate: config.get('sentry.tracesSampleRate'),
clientName: config.get('sentry.clientName'),
serverName: config.get('sentry.serverName'),
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-content-server/server/lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ const conf = (module.exports = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/fxa-content-server/server/lib/routes/get-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = function (config) {
const SENTRY_CLIENT_DSN = config.get('sentry.dsn');
const SENTRY_CLIENT_ENV = config.get('sentry.env');
const SENTRY_SAMPLE_RATE = config.get('sentry.sampleRate');
const SENTRY_TRACES_SAMPLE_RATE = config.get('sentry.tracesSampleRate');
const SENTRY_CLIENT_NAME = config.get('sentry.clientName');
const OAUTH_SERVER_URL = config.get('oauth_url');
const PAIRING_CHANNEL_URI = config.get('pairing.server_base_uri');
Expand Down Expand Up @@ -100,6 +101,7 @@ module.exports = function (config) {
env: SENTRY_CLIENT_ENV,
sampleRate: SENTRY_SAMPLE_RATE,
clientName: SENTRY_CLIENT_NAME,
tracesSampleRate: SENTRY_TRACES_SAMPLE_RATE,
},
staticResourceUrl: STATIC_RESOURCE_URL,
subscriptions: SUBSCRIPTIONS,
Expand Down
1 change: 1 addition & 0 deletions packages/fxa-content-server/server/lib/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ if (config.get('sentry.dsn')) {
dsn: config.get('sentry.dsn'),
env: config.get('sentry.env'),
sampleRate: config.get('sentry.sampleRate'),
tracesSampleRate: config.get('sentry.tracesSampleRate'),
serverName: config.get('sentry.serverName'),
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-customs-server/lib/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ module.exports = function (fs, path, url, convict) {
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-event-broker/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-graphql-api/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-payments-server/server/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
1 change: 1 addition & 0 deletions packages/fxa-payments-server/src/lib/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const expectedMergedConfig = {
dsn: 'https://foo.sentry.io/bar',
env: 'test',
sampleRate: 1.0,
tracesSampleRate: 0,
serverName: 'fxa-payments-server',
},
servers: {
Expand Down
6 changes: 3 additions & 3 deletions packages/fxa-payments-server/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ export interface Config {
termsOfService: string;
};
newsletterId: string;
productRedirectURLs: {
[productId: string]: string;
};
productRedirectURLs: { [productId: string]: string };
sentry: {
dsn: string;
env: string;
sampleRate: number;
tracesSampleRate?: number;
clientName?: string;
serverName?: string;
};
Expand Down Expand Up @@ -74,6 +73,7 @@ export function defaultConfig(): Config {
dsn: '',
env: 'local',
sampleRate: 1.0,
tracesSampleRate: 0,
serverName: 'fxa-payments-server',
clientName: 'fxa-payments-client',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-profile-server/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ const conf = convict({
},
tracesSampleRate: {
doc: 'Rate at which sentry traces are captured',
default: 1.0,
default: 0,
format: 'Number',
env: 'SENTRY_TRACES_SAMPLE_RATE',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-shared/sentry/config-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function buildSentryConfig(config: SentryConfigOpts, log: ILogger) {
clientName: config.sentry?.clientName,
serverName: config.sentry?.serverName,
fxaName: config.sentry?.clientName || config.sentry?.serverName,
tracesSampleRate: config.sentry?.tracesSampleRate || 1.0,
tracesSampleRate: config.sentry?.tracesSampleRate,
};

return opts;
Expand Down

0 comments on commit 96f6e97

Please sign in to comment.