Skip to content

Commit

Permalink
Implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed Jan 17, 2025
1 parent 474df0b commit c27f3e3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
11 changes: 8 additions & 3 deletions adminSiteClient/instrument.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as Sentry from "@sentry/react"
import {
COMMIT_SHA,
ENV,
SENTRY_ADMIN_DSN,
} from "../settings/clientSettings.js"

Sentry.init({
dsn: process.env.SENTRY_ADMIN_DSN,
environment: process.env.ENV,
release: process.env.COMMIT_SHA,
dsn: SENTRY_ADMIN_DSN,
environment: ENV,
release: COMMIT_SHA,
})
4 changes: 2 additions & 2 deletions adminSiteServer/appClass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export class OwidAdminApp {
app.use("/", mockSiteRouter)
}

// Add this after all routes,
// but before any and other error-handling middlewares are defined
// Add this after all routes, but before any other error-handling
// middlewares are defined.
Sentry.setupExpressErrorHandler(app)

// Give full error messages, including in production
Expand Down
7 changes: 0 additions & 7 deletions baker/SiteBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ export class SiteBaker {
}
)
this.explorerAdminServer = new ExplorerAdminServer(GIT_CMS_DIR)
// if (BUGSNAG_NODE_API_KEY) {
// Bugsnag.start({
// apiKey: BUGSNAG_NODE_API_KEY,
// context: "site-baker",
// autoTrackSessions: false,
// })
// }
}

private async bakeEmbeds(knex: db.KnexReadonlyTransaction) {
Expand Down
7 changes: 1 addition & 6 deletions site/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getPreferenceValue, PreferenceType } from "./cookiePreferences.js"

const analyticsConsent = getPreferenceValue(PreferenceType.Analytics)

let sentryOpts: Sentry.BrowserOptions
let sentryOpts: Sentry.BrowserOptions = {}
if (analyticsConsent && !isInIFrame()) {
// only collect session replays from: users that have consented to analytics
// AND where page isn't embedded in an iframe
Expand All @@ -21,11 +21,6 @@ if (analyticsConsent && !isInIFrame()) {
replaysSessionSampleRate: ENV === "development" ? 1 : 0.1,
replaysOnErrorSampleRate: 0,
}
} else {
sentryOpts = {
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
}
}
Sentry.init({
dsn: SENTRY_DSN,
Expand Down

0 comments on commit c27f3e3

Please sign in to comment.