Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage sentry config via env #1437

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-ties-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'backend': patch
---

manage sentry config via env
8 changes: 8 additions & 0 deletions apps/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export const schema = {
SANITY_API_TOKEN: String,
SENTRY_DSN: String,
SENTRY_AUTH_TOKEN: String,
SENTRY_TRACES_SAMPLE_RATE: {
optional: true,
type: Number,
},
SENTRY_PROFILES_SAMPLE_RATE: {
optional: true,
type: Number,
},
AWS_REGION: String,
PROTOCOL: {
optional: true,
Expand Down
4 changes: 2 additions & 2 deletions apps/worker/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export const initWorkerSentry = () => {

// Add Tracing by setting tracesSampleRate
// Send 1% of transactions to Sentry
tracesSampleRate: 0.01,
tracesSampleRate: env.SENTRY_TRACES_SAMPLE_RATE || 0.01,

// Set sampling rate for profiling
// This is relative to tracesSampleRate
profilesSampleRate: 0.01,
profilesSampleRate: env.SENTRY_PROFILES_SAMPLE_RATE || 0.01,

beforeSend: (event) => {
if (event.tags?.job && event.tags?.chain) {
Expand Down
Loading