From 42bc29ef87f4ddcec2e4b56a9429f9ef509f13d6 Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Wed, 26 Mar 2025 12:51:58 +0100 Subject: [PATCH] Update log schemas for field reference (#34432) * update log schemas for field reference * rm unnecessary wh log --- packages/shared-data/logConstants.ts | 57 ++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) 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' }, ], }, ]