Skip to content

Commit 1bf2d13

Browse files
authored
fix: use the same Sentry project for different envs (#167)
Sentry actually supports envs, which is useful when we start doing release notifications properly (which will give us source maps in Sentry) - use them!
1 parent 5188e07 commit 1bf2d13

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

packages/console/.env.tpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ NEXT_PUBLIC_REFERRAL_URL=http://localhost:3001/referred
1717
NEXT_PUBLIC_REFERRALS_SERVICE_URL=http://localhost:4001
1818

1919
# Sentry
20-
NEXT_PUBLIC_SENTRY_DSN=https://cfd48360703c6ab11a8fa3285986b462@o609598.ingest.us.sentry.io/4508462420393984
20+
NEXT_PUBLIC_SENTRY_DSN=https://bf79c216fe3c72328219f04aabeebc99@o609598.ingest.us.sentry.io/4508456692940801
2121
NEXT_PUBLIC_SENTRY_ORG=storacha-it
22-
NEXT_PUBLIC_SENTRY_PROJECT=console-dev
22+
NEXT_PUBLIC_SENTRY_PROJECT=console
23+
NEXT_PUBLIC_SENTRY_ENV=development

packages/console/.github/workflows/deploy-storacha.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,9 @@ jobs:
4444
echo "NEXT_PUBLIC_STRIPE_TRIAL_PRICING_TABLE_ID=prctbl_1QIDHGF6A5ufQX5vOK9Xl8Up" >> .env
4545
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LO87hF6A5ufQX5viNsPTbuErzfavdrEFoBuaJJPfoIhzQXdOUdefwL70YewaXA32ZrSRbK4U4fqebC7SVtyeNcz00qmgNgueC" >> .env
4646
echo "NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL_LINK=https://billing.stripe.com/p/login/test_6oE29Gff99KO6mk8ww" >> .env
47-
echo "NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4508462417772544" >> .env
48-
echo "NEXT_PUBLIC_SENTRY_ORG=storacha-it" >> .env
49-
echo "NEXT_PUBLIC_SENTRY_PROJECT=console-staging" >> .env
50-
51-
# use example.com in preview because we can't predict the preview URL of the storacha.network site
5247
echo "NEXT_PUBLIC_REFERRAL_URL=http://staging.storacha.network/referred" >> .env
5348
echo "NEXT_PUBLIC_REFERRALS_SERVICE_URL=https://staging-referrals.storacha.network" >> .env
49+
echo "NEXT_PUBLIC_SENTRY_ENV=staging" >> .env
5450
# as long as this uses https://github.com/cloudflare/next-on-pages/blob/dc529d7efa8f8568ea8f71b5cdcf78df89be6c12/packages/next-on-pages/bin/index.js,
5551
# env vars won't get passed through to wrangler, so if wrangler will need them, write them to .env like the previous step
5652
- run: pnpm pages:build
@@ -144,9 +140,7 @@ jobs:
144140
echo "NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL_LINK=https://billing.stripe.com/p/login/cN22aA62U6bO1sA9AA" >> .env
145141
echo "NEXT_PUBLIC_REFERRAL_URL=http://storacha.network/referred" >> .env
146142
echo "NEXT_PUBLIC_REFERRALS_SERVICE_URL=https://referrals.storacha.network" >> .env
147-
echo "NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4508456692940801" >> .env
148-
echo "NEXT_PUBLIC_SENTRY_ORG=storacha-it" >> .env
149-
echo "NEXT_PUBLIC_SENTRY_PROJECT=console" >> .env
143+
echo "NEXT_PUBLIC_SENTRY_ENV=production" >> .env
150144
- run: pnpm pages:build
151145
# as long as this uses https://github.com/cloudflare/next-on-pages/blob/dc529d7efa8f8568ea8f71b5cdcf78df89be6c12/packages/next-on-pages/bin/index.js,
152146
# env vars won't get passed through to wrangler, so if wrangler will need them, write them to .env like the previous step

packages/console/sentry.client.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";
66

77
Sentry.init({
88
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
9+
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
910

1011
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1112
tracesSampleRate: 1,

packages/console/sentry.edge.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as Sentry from "@sentry/nextjs";
77

88
Sentry.init({
99
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
10+
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
1011

1112
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1213
tracesSampleRate: 1,

packages/console/sentry.server.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";
66

77
Sentry.init({
88
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
9+
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,
910

1011
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1112
tracesSampleRate: 1,

0 commit comments

Comments
 (0)