Home / Function/ captureQueryPerformanceError() — supabase Function Reference

captureQueryPerformanceError() — supabase Function Reference

Architecture documentation for the captureQueryPerformanceError() function in QueryPerformance.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  e5a814f1_277b_493f_d4bd_8f8fcbe5f72f["captureQueryPerformanceError()"]
  8afea200_94fd_d6c2_5605_0880960a2b8b["WithMonitor()"]
  8afea200_94fd_d6c2_5605_0880960a2b8b -->|calls| e5a814f1_277b_493f_d4bd_8f8fcbe5f72f
  1062988d_666a_109e_9846_15b701cc0d74["WithStatements()"]
  1062988d_666a_109e_9846_15b701cc0d74 -->|calls| e5a814f1_277b_493f_d4bd_8f8fcbe5f72f
  style e5a814f1_277b_493f_d4bd_8f8fcbe5f72f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/QueryPerformance/QueryPerformance.utils.ts lines 53–84

export function captureQueryPerformanceError(
  error: unknown,
  context: QueryPerformanceErrorContext
) {
  Sentry.withScope((scope) => {
    scope.setTag('query-performance', 'true')

    scope.setContext('query-performance', {
      projectRef: context.projectRef,
      databaseIdentifier: context.databaseIdentifier,
      queryPreset: context.queryPreset,
      queryType: context.queryType,
      postgresVersion: context.postgresVersion,
      databaseType: context.databaseType,
      errorMessage: context.errorMessage,
    })

    if (error instanceof Error) {
      Sentry.captureException(error)
      return
    }

    const errorMessage = getErrorMessage(error)
    const errorToCapture = new Error(errorMessage || 'Query performance error')

    if (error !== null && error !== undefined) {
      errorToCapture.cause = error
    }

    Sentry.captureException(errorToCapture)
  })
}

Subdomains

Frequently Asked Questions

What does captureQueryPerformanceError() do?
captureQueryPerformanceError() is a function in the supabase codebase.
What calls captureQueryPerformanceError()?
captureQueryPerformanceError() is called by 2 function(s): WithMonitor, WithStatements.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free