# From vibe code to production-ready: observability for Next.js and Supabase apps

[Sentry](https://yomu.fyi/company/sentry) · Sergiy Dybskiy · May 11, 2026

**Type:** Problem & solution

## Summary

AI-assisted software development often generates functional code that lacks proper instrumentation, leading to unindexed database queries, N+1 patterns, and fragmented connection strategies. While Supabase provides built-in query analytics, security advisors, and subsystem logs, it cannot trace distributed requests across the entire application stack. Integrating Sentry bridges this visibility gap by establishing distributed traces across Next.js frontends, Deno-based Supabase Edge Functions, and Postgres databases. Teams can forward Supabase logs into dedicated Sentry projects and configure runtime integrations to automatically detect performance bottlenecks such as slow spans and Web Vitals regressions. Furthermore, integrating Model Context Protocol servers allows Sentry's Seer debugger to identify root causes and generate automated fixes for emerging issues.

## Context

AI-assisted development tools often generate functional Next.js and Supabase code lacking built-in observability, indexing, or consistent database access patterns. While Supabase provides internal log queries, performance panels, and advisors, it cannot trace requests across the full application stack from frontend actions to database executions.

## Approach / What changed

The author recommends instrumenting Next.js applications and Deno-based Supabase Edge Functions with distinct Sentry SDK configurations, alongside draining Supabase logs into a dedicated Sentry project. Integrating Sentry with Supabase and Model Context Protocol servers enables distributed request tracing, automated N+1 query detection, and AI-driven issue root-cause analysis via Seer.

## Takeaways

- Supabase logs should be routed via log drains into a separate Sentry project from application code to keep telemetry clean and optimize context for AI analysis tools.
- Configuring Sentry's Supabase integration inside Next.js server configuration turns Supabase SDK calls into named spans with timing data to pinpoint slow database queries.
- Supabase Edge Functions run in Deno and require initializing Sentry's Deno SDK at the top of each function file with full trace sampling.

**Tags:** [Monitoring](https://yomu.fyi/topic/monitoring), [Observability](https://yomu.fyi/topic/observability), [Performance](https://yomu.fyi/topic/performance), [Postgres](https://yomu.fyi/topic/postgres)

[Read original post](https://blog.sentry.io/nextjs-supabase-observability)
