Skip to content

Error Tracking with Sentry-Compatible Endpoints

  • Deciders: Julian Bäume
  • Date: 2025-10-31

Status

Accepted

Context

Teams is deployed in production environments where errors may occur due to integration failures, network issues, or unexpected user scenarios. While structured logging with Pino provides detailed logs for operations teams, it lacks critical capabilities for proactive error management:

  • No error aggregation: Similar errors appear as separate log entries, making pattern identification difficult
  • No real-time alerting: Operations teams only discover errors when actively reviewing logs
  • Limited context: Stack traces exist but lack user action breadcrumbs and environment correlation
  • No release tracking: Identifying which deployment introduced regressions requires manual log analysis

Production visibility is essential for a real-time collaboration application where errors directly impact user experience. We need a dedicated error tracking system that complements existing logging infrastructure without replacing it.

Alternatives Considered

1. GitLab Integrated Error Tracking

  • Pros: Sentry-compatible DSN provided by GitLab, data stays in GitLab infrastructure, no additional service required
  • Cons: Requires GitLab Ultimate or self-managed GitLab, feature set more limited than Sentry SaaS
  • Note: Compatible with Sentry SDK, can be used as drop-in replacement by configuring GitLab error tracking DSN

2. Self-hosted error tracking (e.g., Sentry self-hosted, GlitchTip)

  • Pros: Data remains on-premises, full control over infrastructure
  • Cons: Additional operational burden, maintenance overhead, limited feature set compared to SaaS

3. Alternative SaaS providers (e.g., Rollbar, Bugsnag, Datadog)

  • Pros: Similar capabilities to Sentry
  • Cons: Less mature open-source ecosystem, fewer integration options, higher costs for equivalent feature set

4. Enhance existing Pino logging with custom aggregation

  • Pros: No external dependencies, data stays in existing systems
  • Cons: Would require building error aggregation, alerting, and UI ourselves - significant development and maintenance burden

Decision

We will use Sentry-compatible error tracking (GitLab error tracking, Sentry SaaS, or self-hosted Sentry) for error monitoring in both frontend and backend.

The Sentry SDK is integrated at application entry points (src/index.js for backend, ui/teams/main.js for frontend) and captures unhandled exceptions automatically. Backend errors (5xx status codes only) are captured in the logging plugin's error handler with full request context. Frontend configuration is fetched dynamically from the backend via /api/config endpoint, allowing runtime configuration without rebuilds.

Key Integration Points:

  • Backend: Initialize before Fastify app creation, integrate with error handler
  • Frontend: Fetch config asynchronously, initialize with Vue and router integrations
  • Configuration: Helm chart values drive all settings via environment variables

Scope:

  • Error tracking only - Capture production errors with full context
  • No performance monitoring - Simplified configuration and reduced complexity
  • GitLab error tracking recommended - Works out of the box with GitLab Ultimate

Deployment Strategy:

  • Error sample rate: 100% (configurable)

Consequences

Positive

  • Immediate error visibility: Real-time alerts when production errors occur
  • Pattern identification: Automatic error aggregation reveals systemic issues vs isolated incidents
  • Rich debugging context: Stack traces, breadcrumbs, user actions, and environment tags
  • Release correlation: Track which deployments introduce regressions
  • GitLab integration: Works with GitLab error tracking (no additional service required)
  • Mature ecosystem: Well-documented SDKs, active community, extensive integrations
  • Simple configuration: Minimal settings, easy to deploy and maintain

Negative

  • External dependency: Requires error tracking endpoint (GitLab, Sentry SaaS, or self-hosted)
  • Data residency: Error data (including limited user context) sent to error tracking service
  • Limited to error tracking: No performance monitoring in this iteration (can be added later if needed)

Operational Impact

  • Operators must provision error tracking project and configure DSN in Helm charts
  • GitLab Ultimate: Enable error tracking in project settings, copy DSN
  • Sentry SaaS/Self-hosted: Create project, configure DSN
  • Privacy considerations require careful configuration of user context
  • Separate frontend/backend DSNs recommended for better organization but not required

Coexistence with Pino Logging

Error tracking complements but does not replace Pino structured logging:

  • Pino: Detailed operational logs, audit trails, request/response tracking
  • Sentry/GitLab: Error aggregation, alerting, release tracking

Both systems capture errors but serve different purposes. Pino provides complete request context for debugging, while error tracking provides alerting and trend analysis across deployments.

References