Skip to main content

Source: ocean/docs/adr/026-sentry-integration-verification.md | ✏️ Edit on GitHub

ADR-026: Sentry Integration Verification

Status

Accepted

Context

During the issue resolution project, we identified that the baseline analysis indicated two Edge Functions were missing Sentry integration:

  1. /supabase/functions/provision-user-resources/index.ts
  2. /supabase/functions/send-slack-alert/index.ts

However, upon investigation, we discovered:

  1. The function provision-user-resources doesn't exist - the actual function is provision-tenant-resources
  2. Both provision-tenant-resources and send-slack-alert already have Sentry integration
  3. All 13 Edge Functions in the codebase have proper Sentry integration

Decision

No additional Sentry integration work is required. All Edge Functions are properly configured with observability.

Verification Details

Edge Functions with Confirmed Sentry Integration

All functions import and initialize Sentry from the shared observability module:

import { initSentry, Logger } from '../_shared/observability.ts'
initSentry('function-name')

Complete list of verified functions:

  1. /supabase/functions/check-tenant-health/index.ts
  2. /supabase/functions/provision-tenant-resources/index.ts
  3. /supabase/functions/send-slack-alert/index.ts
  4. /supabase/functions/handle-stripe-webhook/index.ts
  5. /supabase/functions/graphql-v2/index.ts
  6. /supabase/functions/stripe-billing/index.ts
  7. /supabase/functions/stripe-portal/index.ts
  8. /supabase/functions/stripe-products/index.ts
  9. /supabase/functions/stripe-setup-intent/index.ts
  10. /supabase/functions/stripe-subscription/index.ts
  11. /supabase/functions/sync-stripe-data/index.ts
  12. /supabase/functions/cleanup-resources/index.ts
  13. /supabase/functions/scheduled-cleanup/index.ts

Shared Observability Module

The /supabase/functions/_shared/observability.ts module provides:

  • Cost-optimized Sentry initialization
  • Structured logging with the Logger class
  • Prometheus-style metrics collection
  • Performance tracking utilities
  • Sampling strategies for cost control

Consequences

Positive

  1. Complete Coverage: All Edge Functions have proper error tracking and observability
  2. Consistent Implementation: All functions use the same observability patterns
  3. Cost Optimized: The shared module includes sampling and cost control measures
  4. No Work Required: This task can be marked as complete without any code changes

Negative

None - The expected work was already completed.

Neutral

  1. The baseline analysis contained outdated or incorrect information
  2. This highlights the importance of verification before implementation

Lessons Learned

  1. Always verify baseline analysis findings before starting implementation
  2. Function names and file paths should be double-checked
  3. Automated scanning tools can help maintain accurate system state documentation

References

  • Issue Resolution Project: /docs/ISSUE_RESOLUTION_PROJECT.md
  • System Baseline Analysis: /docs/SYSTEM_BASELINE_ANALYSIS.md
  • Shared Observability Module: /supabase/functions/_shared/observability.ts

Review Date

Not applicable - verification only, no changes made.