Skip to content

Commit

Permalink
fix: sentry cors tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 28, 2025
1 parent 8a6556a commit d6fe9a5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ x-secure-headers: &headers >-

more_set_headers "Cross-Origin-Opener-Policy: same-origin";

location /api/monitoring {
more_set_headers "Access-Control-Allow-Origin: *";
more_set_headers "Access-Control-Allow-Methods: POST, OPTIONS";
more_set_headers "Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, sentry-trace";
}

global:
pgSecretName: pg-app

Expand Down
2 changes: 1 addition & 1 deletion packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports = withSentryConfig(
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers and CORS issues
tunnelRoute: "/api/monitoring",
tunnelRoute: "/monitoring",

// Don't hide source maps from generated client bundles
hideSourceMaps: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const IS_PRODUCTION = ENVIRONMENT === "production";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: ENVIRONMENT,
tunnel: "/api/monitoring",
tunnel: "/monitoring",

// Optimal sample rates based on environment
tracesSampleRate: IS_PRODUCTION ? 0.1 : 1.0,
Expand Down

0 comments on commit d6fe9a5

Please sign in to comment.