Skip to content

Commit cb5feda

Browse files
authored
Merge branch 'main' into cm/fix-file-from-url-flow
2 parents 202b355 + 633daa4 commit cb5feda

File tree

8 files changed

+35
-8
lines changed

8 files changed

+35
-8
lines changed

apps/hash-ai-worker-ts/src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import * as Sentry from "@sentry/node";
55
Sentry.init({
66
dsn: process.env.HASH_TEMPORAL_WORKER_AI_SENTRY_DSN,
77
enabled: !!process.env.HASH_TEMPORAL_WORKER_AI_SENTRY_DSN,
8+
environment:
9+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
10+
process.env.SENTRY_ENVIRONMENT ||
11+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
12+
process.env.ENVIRONMENT ||
13+
(process.env.NODE_ENV === "production" ? "production" : "development"),
814
tracesSampleRate: process.env.NODE_ENV === "production" ? 1.0 : 0,
915
});
1016

apps/hash-api/src/instrument.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const sentryDsn = process.env.NODE_API_SENTRY_DSN;
2020
Sentry.init({
2121
dsn: sentryDsn,
2222
enabled: !!sentryDsn,
23-
environment: isProdEnv ? "production" : "development",
23+
environment:
24+
process.env.SENTRY_ENVIRONMENT ||
25+
process.env.ENVIRONMENT ||
26+
(isProdEnv ? "production" : "development"),
2427
sendDefaultPii: true,
2528
tracesSampleRate: isProdEnv ? 1.0 : 0,
2629
});

apps/hash-frontend/instrumentation-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { buildStamp } from "./buildstamp";
77
import { isProduction } from "./src/lib/config";
88
import {
99
SENTRY_DSN,
10+
SENTRY_ENVIRONMENT,
1011
SENTRY_REPLAYS_SESSION_SAMPLE_RATE,
11-
VERCEL_ENV,
1212
} from "./src/lib/public-env";
1313

1414
Sentry.init({
1515
dsn: SENTRY_DSN,
1616
enabled: !!SENTRY_DSN,
17-
environment: VERCEL_ENV || "development",
17+
environment: SENTRY_ENVIRONMENT,
1818
integrations: [
1919
Sentry.browserApiErrorsIntegration(),
2020
Sentry.browserProfilingIntegration(),

apps/hash-frontend/next.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ process.env.NEXT_PUBLIC_API_ORIGIN =
4646
process.env.API_ORIGIN ?? "http://localhost:5001";
4747

4848
process.env.NEXT_PUBLIC_SENTRY_DSN = process.env.SENTRY_DSN ?? "";
49+
process.env.NEXT_PUBLIC_ENVIRONMENT = process.env.ENVIRONMENT ?? "";
50+
process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT =
51+
process.env.SENTRY_ENVIRONMENT ?? "";
4952
process.env.NEXT_PUBLIC_SENTRY_REPLAY_SESSION_SAMPLE_RATE =
5053
process.env.SENTRY_REPLAY_SESSION_SAMPLE_RATE ?? "1";
5154

apps/hash-frontend/sentry.edge.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as Sentry from "@sentry/nextjs";
22

33
import { buildStamp } from "./buildstamp";
44
import { isProduction } from "./src/lib/config";
5-
import { SENTRY_DSN, VERCEL_ENV } from "./src/lib/public-env";
5+
import { SENTRY_DSN, SENTRY_ENVIRONMENT } from "./src/lib/public-env";
66

77
Sentry.init({
88
dsn: SENTRY_DSN,
99
enabled: !!SENTRY_DSN,
10-
environment: VERCEL_ENV || "development",
10+
environment: SENTRY_ENVIRONMENT,
1111
release: buildStamp,
1212
sendDefaultPii: true,
1313
// release is set in next.config.js in the Sentry webpack plugin

apps/hash-frontend/sentry.server.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as Sentry from "@sentry/nextjs";
22

33
import { buildStamp } from "./buildstamp";
44
import { isProduction } from "./src/lib/config";
5-
import { SENTRY_DSN, VERCEL_ENV } from "./src/lib/public-env";
5+
import { SENTRY_DSN, SENTRY_ENVIRONMENT } from "./src/lib/public-env";
66

77
Sentry.init({
88
dsn: SENTRY_DSN,
99
enabled: !!SENTRY_DSN,
10-
environment: VERCEL_ENV || "development",
10+
environment: SENTRY_ENVIRONMENT,
1111
release: buildStamp,
1212
sendDefaultPii: true,
1313
// release is set in next.config.js in the Sentry webpack plugin

apps/hash-frontend/src/lib/public-env.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@ export const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN;
33
export const SENTRY_REPLAYS_SESSION_SAMPLE_RATE =
44
process.env.NEXT_PUBLIC_SENTRY_REPLAYS_SESSION_SAMPLE_RATE;
55

6-
export const VERCEL_ENV = process.env.NEXT_PUBLIC_VERCEL_ENV ?? "unset";
6+
export const ENVIRONMENT =
7+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
8+
process.env.NEXT_PUBLIC_ENVIRONMENT ||
9+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
10+
process.env.NEXT_PUBLIC_VERCEL_ENV ||
11+
"development";
12+
13+
export const SENTRY_ENVIRONMENT =
14+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
15+
process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || ENVIRONMENT;

apps/hash-integration-worker/src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import * as Sentry from "@sentry/node";
55
Sentry.init({
66
dsn: process.env.HASH_TEMPORAL_WORKER_INTEGRATION_SENTRY_DSN,
77
enabled: !!process.env.HASH_TEMPORAL_WORKER_INTEGRATION_SENTRY_DSN,
8+
environment:
9+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
10+
process.env.SENTRY_ENVIRONMENT ||
11+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
12+
process.env.ENVIRONMENT ||
13+
(process.env.NODE_ENV === "production" ? "production" : "development"),
814
tracesSampleRate: process.env.NODE_ENV === "production" ? 1.0 : 0,
915
});
1016

0 commit comments

Comments
 (0)