Home / Function/ fetchLogs() — supabase Function Reference

fetchLogs() — supabase Function Reference

Architecture documentation for the fetchLogs() function in SharedAPIReport.constants.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  89b35970_22dc_effb_068b_3b45b822f400["fetchLogs()"]
  d0014f9c_78f0_5d28_6b3b_8689773a942d["useSharedAPIReport()"]
  d0014f9c_78f0_5d28_6b3b_8689773a942d -->|calls| 89b35970_22dc_effb_068b_3b45b822f400
  style 89b35970_22dc_effb_068b_3b45b822f400 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/studio/components/interfaces/Reports/SharedAPIReport/SharedAPIReport.constants.ts lines 185–219

const fetchLogs = async ({
  projectRef,
  sql,
  start,
  end,
}: {
  projectRef: string
  sql: string
  start: string
  end: string
}) => {
  const { data, error } = await get(`/platform/projects/{ref}/analytics/endpoints/logs.all`, {
    params: {
      path: { ref: projectRef },
      query: {
        sql,
        iso_timestamp_start: start,
        iso_timestamp_end: end,
      },
    },
  })

  if (error || data?.error) {
    Sentry.captureException({
      message: 'Shared API Report Error',
      data: {
        error,
        data,
      },
    })
    throw error || data?.error
  }

  return data
}

Subdomains

Frequently Asked Questions

What does fetchLogs() do?
fetchLogs() is a function in the supabase codebase.
What calls fetchLogs()?
fetchLogs() is called by 1 function(s): useSharedAPIReport.

Analyze Your Own Codebase

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

Try Supermodel Free