Merge pull request #16223 from supabase/chore/warning-log-explorer-postgres-adapter

When user isn't using Big Query adapter, we warn the user that they c…
This commit is contained in:
Ziinc authored and GitHub committed 2023-08-08 23:31:03 +08:00
commit 45400a721b
3 files changed
+11 -1

No files matched your search

@@ -103,6 +103,8 @@ docker compose -f docker-compose.yml up
> ⚠️ WARNING: Please be aware of the heavy consumption of analytics. For heavy usage you might want to consider the usage of a different database for analytics only by updating the `POSTGRES_BACKEND_URL` in the `analytics` service on the `docker-compose.yml` file.
Also be aware that you won't be able to use [Log Explorer](https://supabase.com/docs/guides/platform/logs#logs-explorer) when using the Postgres Backend as some of the querying features are still not supported by our translation layer.
#### Using the Big Query Backend
Using the example [self-hosting stack based on docker-compose](https://github.com/supabase/supabase/tree/master/docker), you include the logging related services using the following command
@@ -113,7 +115,6 @@ Using the example [self-hosting stack based on docker-compose](https://github.co
- `GOOGLE_PROJECT_NUMBER`
2. Place your Service Account key in your present working directory with the filename `gcloud.json`.
3. On `docker-compose.yml`, uncomment the block section below the commentary `# Uncomment to use Big Query backend for analytics`
4. On `docker-compose.yml`, comment the block section below the commentary `# Comment variables to use Big Query backend for analytics`
+4
View File
@@ -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: bigquery
kong:
container_name: supabase-kong
@@ -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 !== 'bigquery') {
return res
.status(400)
.json({ error: { message: 'Log Explorer is only supported by the [analytics] Big Query backend. Please refer to https://supabase.com/docs/reference/self-hosting-analytics/introduction for more information' } })
}
const missingEnvVars = [
process.env.LOGFLARE_API_KEY ? null : 'LOGFLARE_API_KEY',
process.env.LOGFLARE_URL ? null : 'LOGFLARE_URL',