Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add warning to avoid log explorer usage when Postgres backend is the chosen analytics backend

Filipe Cabaco4a53b7c12d1d
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index b4d69bbca7c..f2f98c51ae3 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -46,6 +46,10 @@ services:
LOGFLARE_API_KEY: ${LOGFLARE_API_KEY}
LOGFLARE_URL: http://analytics:4000
NEXT_PUBLIC_ENABLE_LOGS: true
+ # Comment to use Big Query backend for analytics
+ NEXT_ANALYTICS_BACKEND_PROVIDER: postgres
+ # Uncomment to use Big Query backend for analytics
+ # NEXT_ANALYTICS_BACKEND_PROVIDER: big_query
kong:
container_name: supabase-kong
diff --git a/studio/.env b/studio/.env
index 8e5892b00b6..3b329d482c7 100644
--- a/studio/.env
+++ b/studio/.env
@@ -20,3 +20,6 @@ NEXT_PUBLIC_HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001
# CmdK / AI
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhndWloeHV6cWlid3hqbmlteGV2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzUwOTQ4MzUsImV4cCI6MTk5MDY3MDgzNX0.0PMlOxtKL4O9GGZuAP_Xl4f-Tut1qOnW4bNEmAtoB8w
NEXT_PUBLIC_SUPABASE_URL=https://xguihxuzqibwxjnimxev.supabase.co
+NEXT_ANALYTICS_BACKEND_PROVIDER=postgres
+NEXT_PUBLIC_ENABLE_LOGS=true
+NEXT_ANALYTICS_BACKEND_PROVIDER=big_query
\ No newline at end of file
diff --git a/studio/pages/api/projects/[ref]/analytics/endpoints/[name].ts b/studio/pages/api/projects/[ref]/analytics/endpoints/[name].ts
index b9ab5791bea..8ab24a44941 100644
--- a/studio/pages/api/projects/[ref]/analytics/endpoints/[name].ts
+++ b/studio/pages/api/projects/[ref]/analytics/endpoints/[name].ts
@@ -15,6 +15,11 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
.status(400)
.json({ error: { message: '[analytics] is not enabled in supabase/config.toml' } })
}
+ if (process.env.NEXT_ANALYTICS_BACKEND_PROVIDER !== 'big_query') {
+ return res
+ .status(400)
+ .json({ error: { message: 'Log Explorer is only supported by the [analytics] Big Query backend, please refer to the documentation to set it up' } })
+ }
const missingEnvVars = [
process.env.LOGFLARE_API_KEY ? null : 'LOGFLARE_API_KEY',
process.env.LOGFLARE_URL ? null : 'LOGFLARE_URL',