Logflare / logflare

Never get surprised by a logging bill again. Centralized structured logging for Cloudflare, Vercel, Elixir and Javascript.
https://logflare.app
Apache License 2.0
835 stars 45 forks source link

Supabase Self-hosted: Getting Api Gateway logs in BigQuery failes with error 'Name metadata not found inside t at' #2245

Open srasul opened 2 weeks ago

srasul commented 2 weeks ago

We are using Supabase Self-hosted with BigQuery as the 'sink' for our logs. When trying to fetch the logs in Supabase Studio, we get the following error:

{
  "code": 400,
  "errors": [
    {
      "domain": "global",
      "location": "q",
      "locationType": "parameter",
      "message": "Name metadata not found inside t at [1:1060]",
      "reason": "invalidQuery"
    }
  ],
  "message": "Name metadata not found inside t at [1:1060]",
  "status": "INVALID_ARGUMENT"
}

Analyzing the query that is sent to BQ, we see that in the query we are selecting t.metadata from tables.

image

But when I look at the data in some of the tables, I notice we have no data in these tables, so the only columns in the tables are:

So therefore, we are trying to query for a column that does not exist. And it see that even though this big-query SQL has the SQL to query for all the tables, only one table is actually queried. But since we send the SQL for all tables, this means that the SQL has to be valid for all the tables.

image

Can you advise how we can proceed with this? or steps we can take to get these queries in BQ to run without any errors?