Skip to content

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

Update log schemas for field reference (#34432)

Jordi Enric42bc29ef87f4
diff --git a/packages/shared-data/logConstants.ts b/packages/shared-data/logConstants.ts
index 89089e95f57..363838b47b3 100644
--- a/packages/shared-data/logConstants.ts
+++ b/packages/shared-data/logConstants.ts
@@ -1,6 +1,28 @@
-const schemas = [
+type LogTable =
+ | 'edge_logs'
+ | 'postgres_logs'
+ | 'function_logs'
+ | 'function_edge_logs'
+ | 'auth_logs'
+ | 'realtime_logs'
+ | 'storage_logs'
+ | 'postgrest_logs'
+ | 'supavisor_logs'
+ | 'pgbouncer_logs'
+ | 'pg_cron_logs'
+
+type LogSchema = {
+ name: string
+ reference: LogTable
+ fields: {
+ path: string
+ type: string
+ }[]
+}
+
+const schemas: LogSchema[] = [
{
- name: 'API Edge',
+ name: 'API Gateway',
reference: 'edge_logs',
fields: [
{ path: 'id', type: 'string' },
@@ -229,13 +251,42 @@ const schemas = [
],
},
{
- name: 'Supavisor',
+ name: 'Supavisor (Shared Pooler)',
reference: 'supavisor_logs',
fields: [
{ path: 'event_message', type: 'string' },
{ path: 'id', type: 'string' },
{ path: 'timestamp', type: 'datetime' },
+ { path: 'metadata.context.application', type: 'string' },
+ { path: 'metadata.context.domain', type: 'string[]' },
+ { path: 'metadata.context.file', type: 'string' },
+ { path: 'metadata.context.function', type: 'string' },
+ { path: 'metadata.context.gl', type: 'string' },
+ { path: 'metadata.context.line', type: 'number' },
+ { path: 'metadata.context.mfa', type: 'string[]' },
+ { path: 'metadata.context.module', type: 'string' },
+ { path: 'metadata.context.pid', type: 'string' },
+ { path: 'metadata.context.time', type: 'number' },
+ { path: 'metadata.context.vm.node', type: 'string' },
+ { path: 'metadata.db_name', type: 'string' },
+ { path: 'metadata.instance_id', type: 'string' },
+ { path: 'metadata.level', type: 'string' },
+ { path: 'metadata.project', type: 'string' },
+ { path: 'metadata.region', type: 'string' },
+ { path: 'metadata.type', type: 'string' },
+ { path: 'metadata.user', type: 'string' },
+ ],
+ },
+ {
+ name: 'PgBouncer (Dedicated Pooler)',
+ reference: 'pgbouncer_logs',
+ fields: [
+ { path: 'id', type: 'string' },
+ { path: 'event_message', type: 'string' },
+ { path: 'file', type: 'string' },
+ { path: 'timestamp', type: 'datetime' },
{ path: 'metadata.host', type: 'string' },
+ { path: 'project', type: 'string' },
],
},
]