Skip to content

Commit

Permalink
fix: use the same Sentry project for different envs (#167)
Browse files Browse the repository at this point in the history
Sentry actually supports envs, which is useful when we start doing
release notifications properly (which will give us source maps in
Sentry) - use them!
  • Loading branch information
travis authored Dec 18, 2024
1 parent 3e7069a commit 32dd6f8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ NEXT_PUBLIC_REFERRAL_URL=http://localhost:3001/referred
NEXT_PUBLIC_REFERRALS_SERVICE_URL=http://localhost:4001

# Sentry
NEXT_PUBLIC_SENTRY_DSN=https://cfd48360703c6ab11a8fa3285986b462@o609598.ingest.us.sentry.io/4508462420393984
NEXT_PUBLIC_SENTRY_DSN=https://bf79c216fe3c72328219f04aabeebc99@o609598.ingest.us.sentry.io/4508456692940801
NEXT_PUBLIC_SENTRY_ORG=storacha-it
NEXT_PUBLIC_SENTRY_PROJECT=console-dev
NEXT_PUBLIC_SENTRY_PROJECT=console
NEXT_PUBLIC_SENTRY_ENV=development
10 changes: 2 additions & 8 deletions .github/workflows/deploy-storacha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,9 @@ jobs:
echo "NEXT_PUBLIC_STRIPE_TRIAL_PRICING_TABLE_ID=prctbl_1QIDHGF6A5ufQX5vOK9Xl8Up" >> .env
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LO87hF6A5ufQX5viNsPTbuErzfavdrEFoBuaJJPfoIhzQXdOUdefwL70YewaXA32ZrSRbK4U4fqebC7SVtyeNcz00qmgNgueC" >> .env
echo "NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL_LINK=https://billing.stripe.com/p/login/test_6oE29Gff99KO6mk8ww" >> .env
echo "NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4508462417772544" >> .env
echo "NEXT_PUBLIC_SENTRY_ORG=storacha-it" >> .env
echo "NEXT_PUBLIC_SENTRY_PROJECT=console-staging" >> .env
# use example.com in preview because we can't predict the preview URL of the storacha.network site
echo "NEXT_PUBLIC_REFERRAL_URL=http://staging.storacha.network/referred" >> .env
echo "NEXT_PUBLIC_REFERRALS_SERVICE_URL=https://staging-referrals.storacha.network" >> .env
echo "NEXT_PUBLIC_SENTRY_ENV=staging" >> .env
# as long as this uses https://github.com/cloudflare/next-on-pages/blob/dc529d7efa8f8568ea8f71b5cdcf78df89be6c12/packages/next-on-pages/bin/index.js,
# env vars won't get passed through to wrangler, so if wrangler will need them, write them to .env like the previous step
- run: pnpm pages:build
Expand Down Expand Up @@ -144,9 +140,7 @@ jobs:
echo "NEXT_PUBLIC_STRIPE_CUSTOMER_PORTAL_LINK=https://billing.stripe.com/p/login/cN22aA62U6bO1sA9AA" >> .env
echo "NEXT_PUBLIC_REFERRAL_URL=http://storacha.network/referred" >> .env
echo "NEXT_PUBLIC_REFERRALS_SERVICE_URL=https://referrals.storacha.network" >> .env
echo "NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4508456692940801" >> .env
echo "NEXT_PUBLIC_SENTRY_ORG=storacha-it" >> .env
echo "NEXT_PUBLIC_SENTRY_PROJECT=console" >> .env
echo "NEXT_PUBLIC_SENTRY_ENV=production" >> .env
- run: pnpm pages:build
# as long as this uses https://github.com/cloudflare/next-on-pages/blob/dc529d7efa8f8568ea8f71b5cdcf78df89be6c12/packages/next-on-pages/bin/index.js,
# env vars won't get passed through to wrangler, so if wrangler will need them, write them to .env like the previous step
Expand Down
1 change: 1 addition & 0 deletions sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,

// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
Expand Down
1 change: 1 addition & 0 deletions sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,

// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
Expand Down
1 change: 1 addition & 0 deletions sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENV,

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

0 comments on commit 32dd6f8

Please sign in to comment.