Skip to content

Sentry Error Tracking Deployment

This document explains how to configure Sentry error tracking for App Suite Teams. Teams supports standard Sentry-compatible DSNs, including Sentry SaaS, self-hosted Sentry, and GitLab Integrated Error Tracking.

Overview

Teams uses the Sentry SDK for error tracking. The application is designed to work with any Sentry-compatible endpoint, requiring only a valid DSN (Data Source Name).

Key Features:

  • Backend error tracking (5xx errors only)
  • Frontend error tracking (all unhandled exceptions)
  • Runtime configuration (frontend settings served dynamically via authenticated /api/config endpoint)

GitLab provides Sentry-compatible error tracking built into GitLab Ultimate and self-managed instances. This is the recommended option if you already use GitLab.

Requirements

  • GitLab Ultimate subscription (SaaS) or self-managed GitLab instance
  • Project with error tracking enabled

Setup Steps

  1. Enable Error Tracking in GitLab Project

    Navigate to your GitLab project:

    • Go to Settings → Monitor → Error Tracking
    • Click Enable Error Tracking
    • GitLab will generate a Sentry-compatible DSN
  2. Copy the DSN

    After enabling, GitLab displays the DSN in the format:

    https://<key>@<gitlab-instance>/api/v4/error_tracking/collector/<project-id>
  3. Configure Helm Values

    Update helm/teams/values.yaml:

    sentry:
      enabled: true
      dsn: "https://<key>@<gitlab-instance>/api/v4/error_tracking/collector/<project-id>"
      environment: "production"
      sampleRate: 1.0

    Or use an existing Kubernetes Secret (recommended for GitOps workflows):

    sentry:
      enabled: true
      existingSecret: "sentry-dsn-secret"
      dsnKey: "sentry-dsn"              # key within the secret, default: sentry-dsn
      environment: "production"
      sampleRate: 1.0
  4. Deploy

    Deploy the Helm chart with updated values. Errors will now appear in: GitLab Project → Monitor → Error Tracking

GitLab Features

  • View errors grouped by type and frequency
  • Stack traces with file links to source code
  • Filter by environment and release
  • Issue integration (create GitLab issues from errors)

Note

This integration focuses on error tracking only. Performance monitoring features (if provided by the endpoint) are not configured in this iteration.

Option 2: Sentry SaaS

Requirements

  • Sentry account at sentry.io
  • Organization and project created in Sentry

Setup Steps

  1. Create Sentry Project

    In Sentry dashboard:

    • Navigate to Projects → Create Project
    • Select platform: Node.js (for backend) or Vue (for frontend)
    • Note: You can use a single project for both or separate projects
  2. Copy DSN

    After project creation, Sentry displays the DSN:

    https://<key>@<organization>.ingest.sentry.io/<project-id>
  3. Configure Helm Values

    Update helm/teams/values.yaml:

    sentry:
      enabled: true
      dsn: "https://<key>@<organization>.ingest.sentry.io/<project-id>"
      # Optional: Use separate DSNs for frontend and backend
      dsnFrontend: "https://<key>@<organization>.ingest.sentry.io/<frontend-project-id>"
      environment: "production"
      sampleRate: 1.0
  4. Deploy

    Deploy the Helm chart. Errors will appear in Sentry dashboard.

Option 3: Self-Hosted Sentry

Requirements

  • Self-hosted Sentry instance (e.g., using Docker)
  • Network access from Teams deployment to Sentry instance

Setup Steps

  1. Deploy Sentry

    Follow Sentry self-hosting guide

  2. Create Project

    In your Sentry instance, create a project and copy the DSN

  3. Configure Helm Values

    Update helm/teams/values.yaml:

    sentry:
      enabled: true
      dsn: "https://<key>@<your-sentry-host>/<project-id>"
      environment: "production"
      sampleRate: 1.0

Configuration Reference

Helm Chart Values

Complete sentry section in helm/teams/values.yaml:

sentry:
  # Enable/disable Sentry error tracking
  enabled: true

  # Option A: Plain DSN values
  # Backend Sentry DSN (required if enabled is true and existingSecret is not set)
  dsn: ""
  # Frontend DSN (optional, defaults to backend DSN)
  dsnFrontend: ""

  # Option B: DSN from existing Kubernetes Secret (recommended for GitOps)
  # When set, dsn/dsnFrontend values are ignored
  existingSecret: ""
  # Key in the existing secret containing the backend DSN
  dsnKey: "sentry-dsn"
  # Key in the existing secret containing the frontend DSN (optional)
  # If empty, falls back to dsnKey
  dsnFrontendKey: ""

  # Environment tag (dev/staging/production)
  environment: "production"

  # Release version (defaults to chart appVersion)
  release: ""

  # Error sample rate (0.0-1.0, default: 1.0)
  # 1.0 = capture all errors
  sampleRate: 1.0

  # Debug mode (default: false)
  # Enables verbose Sentry SDK logging
  debug: false

Environment Variables

The Helm chart automatically configures these environment variables:

Backend:

  • SENTRY_DSN - Backend DSN
  • SENTRY_ENVIRONMENT - Environment tag
  • SENTRY_RELEASE - Release version
  • SENTRY_SAMPLE_RATE - Error sample rate
  • SENTRY_DEBUG - Debug mode

Frontend (served via /api/config):

  • SENTRY_DSN_FRONTEND - Frontend DSN (falls back to SENTRY_DSN)

Note: Performance monitoring (SENTRY_TRACES_SAMPLE_RATE) is not configured in this iteration.

Sample Rate Recommendations

Production Environments

sentry:
  sampleRate: 1.0              # Capture all errors

Staging Environments

sentry:
  sampleRate: 1.0              # Capture all errors

Development Environments

sentry:
  sampleRate: 1.0              # Capture all errors
  debug: true                  # Enable debug logging

Verification

After deployment, verify Sentry is working:

  1. Check Backend Logs

    Look for Sentry initialization message:

    {"level":"info","msg":"Sentry initialized for error tracking","environment":"production","release":"1.0.0"}
  2. Check Frontend Console

    Open browser console and look for:

    [Sentry] Initialized for error tracking { environment: 'production', release: '1.0.0' }
  3. Trigger Test Error

    Backend: Use invalid configuration (e.g., wrong database credentials) Frontend: Open browser console and run: throw new Error('Test Sentry')

  4. Verify in Dashboard

    • GitLab: Check Monitor → Error Tracking
    • Sentry: Check Sentry dashboard for new issues

Privacy Considerations

User Context

Errors include user context (user ID and email) for debugging. To disable:

sentry:
  enabled: true
  # User context is included by default
  # To disable, set DSN to empty string or set enabled: false

User context cannot be disabled selectively; it's all-or-nothing with the current implementation.

Troubleshooting

Errors Not Appearing

  1. Verify DSN is configured: Check Helm values and deployment environment variables
  2. Check logs: Look for Sentry initialization messages
  3. Verify network connectivity: Ensure Teams can reach Sentry endpoint
  4. Check sample rates: Ensure rates are > 0.0
  5. Backend errors: Only 5xx errors are captured; 4xx errors are ignored

Frontend Config Not Loading

  1. Verify /api/config endpoint: Visit https://your-teams-instance/api/config (requires authentication)
  2. Check authentication: Ensure JWT is available when frontend initializes
  3. Check browser console: Look for authentication errors or fetch failures

High Quota Usage

  1. Reduce error sample rate (if needed):

    sentry:
      sampleRate: 0.5  # Capture 50% of errors instead of 100%
  2. Add error filters: Configure in Sentry/GitLab dashboard to ignore specific error patterns

  3. Separate DSNs: Use different projects for frontend/backend to track quota separately