Skip to main content

Source: ocean/docs/production-monitoring-setup.md | ✏️ Edit on GitHub

Production Monitoring Setup

This guide explains how to properly configure Sentry and PostHog for production.

Current Issues

  1. Sentry 403 Forbidden: The domain ocean.goldfish.io is not in the allowed domains list
  2. PostHog 401 Unauthorized: Missing or invalid API key in production environment

Sentry Configuration

1. Add Domain to Allowed Domains

  1. Log in to Sentry
  2. Go to SettingsProjects → Select your project
  3. Navigate to Security & PrivacyAllowed Domains
  4. Add these domains:
    • ocean.goldfish.io
    • *.goldfish.io (if you want to allow all subdomains)
    • localhost:* (for local development)
  5. Save changes

2. Verify DSN Configuration

Your current DSN appears to be: https://[YOUR_SENTRY_DSN]@sentry.io/[PROJECT_ID]

Ensure this is set in your production environment:

VITE_SENTRY_DSN=https://[YOUR_SENTRY_DSN]@sentry.io/[PROJECT_ID]

PostHog Configuration

1. Get Your PostHog API Key

  1. Log in to PostHog
  2. Go to Project SettingsAPI Keys
  3. Copy the Project API Key (starts with phc_)

2. Set Environment Variables

Add these to your production environment (Vercel/Railway/etc):

VITE_POSTHOG_API_KEY=phc_your_actual_key_here
VITE_POSTHOG_HOST=https://us.posthog.com
VITE_POSTHOG_PROJECT_ID=your_project_id

Vercel Configuration (if applicable)

  1. Go to your Vercel project dashboard
  2. Navigate to SettingsEnvironment Variables
  3. Add the following variables for Production:
    • VITE_SENTRY_DSN
    • VITE_POSTHOG_API_KEY
    • VITE_POSTHOG_HOST
    • VITE_POSTHOG_PROJECT_ID
  4. Redeploy your application

Testing

After configuration:

  1. Clear your browser cache
  2. Visit https://ocean.goldfish.io
  3. Open browser console
  4. Verify no 403/401 errors appear
  5. Test an action that would trigger analytics

Optional: Disable Monitoring for Development

If you don't want monitoring in development, simply don't set these environment variables locally. The application will run without Sentry or PostHog.