infra: hook up sentry
This commit is contained in:
@@ -23,7 +23,7 @@ type AppConfig = {
|
|||||||
orionUrl: string;
|
orionUrl: string;
|
||||||
pusherUrl: string;
|
pusherUrl: string;
|
||||||
firebase: FirebaseConfig;
|
firebase: FirebaseConfig;
|
||||||
/** Empty string disables Sentry. Populate per-env when ready to ship. */
|
/** Empty string disables Sentry. Same DSN across envs; events are split by `environment` tag. */
|
||||||
sentryDsn: string;
|
sentryDsn: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ const configs: Record<"dev" | "prod", AppConfig> = {
|
|||||||
projectId: "flowy-dev-440017",
|
projectId: "flowy-dev-440017",
|
||||||
storageBucket: "flowy-dev-440017.firebasestorage.app",
|
storageBucket: "flowy-dev-440017.firebasestorage.app",
|
||||||
},
|
},
|
||||||
sentryDsn: "",
|
sentryDsn: "https://4bb3af832825929eeec8ab4edd56930f@o4511282312118272.ingest.us.sentry.io/4511282313494528",
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
orionUrl: "https://orion.flowy.live",
|
orionUrl: "https://orion.flowy.live",
|
||||||
@@ -52,7 +52,7 @@ const configs: Record<"dev" | "prod", AppConfig> = {
|
|||||||
projectId: "flowy-prod-440017",
|
projectId: "flowy-prod-440017",
|
||||||
storageBucket: "flowy-prod-440017.firebasestorage.app",
|
storageBucket: "flowy-prod-440017.firebasestorage.app",
|
||||||
},
|
},
|
||||||
sentryDsn: "",
|
sentryDsn: "https://4bb3af832825929eeec8ab4edd56930f@o4511282312118272.ingest.us.sentry.io/4511282313494528",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as Sentry from "@sentry/electron/renderer";
|
import * as Sentry from "@sentry/electron/renderer";
|
||||||
import { appConfig } from "@/config/env";
|
import { appConfig, appEnv } from "@/config/env";
|
||||||
import { installErrorSinks } from "@/lib/errors";
|
import { installErrorSinks } from "@/lib/errors";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,6 +11,7 @@ export function initSentryRenderer(): void {
|
|||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: appConfig.sentryDsn,
|
dsn: appConfig.sentryDsn,
|
||||||
|
environment: appEnv,
|
||||||
tracesSampleRate: 0,
|
tracesSampleRate: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { app } from "electron";
|
import { app } from "electron";
|
||||||
import * as Sentry from "@sentry/electron/main";
|
import * as Sentry from "@sentry/electron/main";
|
||||||
import { appConfig } from "@/config/env";
|
import { appConfig, appEnv } from "@/config/env";
|
||||||
import { installErrorSinks } from "@/lib/errors";
|
import { installErrorSinks } from "@/lib/errors";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,6 +12,7 @@ export function initSentryMain(): void {
|
|||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: appConfig.sentryDsn,
|
dsn: appConfig.sentryDsn,
|
||||||
|
environment: appEnv,
|
||||||
tracesSampleRate: 0,
|
tracesSampleRate: 0,
|
||||||
release: app.getVersion(),
|
release: app.getVersion(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user