From 96d39ad728a003537711e47d7ab0681b225db485 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Mon, 7 Apr 2025 13:55:04 +0700 Subject: [PATCH] QFIX: Fix huge statistics send (#8482) Signed-off-by: Andrey Sobolev --- pods/stats/src/stats.ts | 2 +- server/backup/src/backup.ts | 6 +----- server/backup/src/service.ts | 4 ++-- server/workspace-service/src/service.ts | 3 +-- server/workspace-service/src/ws-operations.ts | 2 +- services/ai-bot/pod-ai-bot/src/controller.ts | 4 ++-- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pods/stats/src/stats.ts b/pods/stats/src/stats.ts index 46bf6a31fe..1400e1c8a4 100644 --- a/pods/stats/src/stats.ts +++ b/pods/stats/src/stats.ts @@ -172,7 +172,7 @@ export function serveStats (ctx: MeasureContext, onClose?: () => void): void { const service = payload.extra?.service === 'true' const serviceName = (req.query.name as string) ?? '' if (service) { - ctx.info('put stats', { service: req.query.name }) + ctx.info('put stats', { service: req.query.name, len: req.request.length }) statistics.set(serviceName, { ...(req.request.body as ServiceStatistics), lastUpdate: Date.now() diff --git a/server/backup/src/backup.ts b/server/backup/src/backup.ts index ba5217c2aa..2d0ff76cc9 100644 --- a/server/backup/src/backup.ts +++ b/server/backup/src/backup.ts @@ -705,11 +705,7 @@ export async function backup ( blobsSize: 0, backupSize: 0 } - ctx = ctx.newChild('backup', { - workspaceId: workspaceId.name, - force: options.force, - timeout: options.timeout - }) + ctx = ctx.newChild('backup', {}) let _canceled = false const canceled = (): boolean => { diff --git a/server/backup/src/service.ts b/server/backup/src/service.ts index 63a7d9e0c8..6ffc15fe61 100644 --- a/server/backup/src/service.ts +++ b/server/backup/src/service.ts @@ -265,7 +265,7 @@ class BackupWorker { rootCtx.warn('\n\nBACKUP WORKSPACE ', { workspace: ws.workspace }) - const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace }) + const ctx = rootCtx.newChild('doBackup', {}) let pipeline: Pipeline | undefined try { const storage = await createStorageBackupStorage( @@ -446,7 +446,7 @@ export async function doRestoreWorkspace ( rootCtx.warn('\nRESTORE WORKSPACE ', { workspace: ws.workspace }) - const ctx = rootCtx.newChild(ws.workspace, { workspace: ws.workspace }) + const ctx = rootCtx.newChild('doRestoreWorkspace', {}) let pipeline: Pipeline | undefined try { const storage = await createStorageBackupStorage(ctx, backupAdapter, getWorkspaceId(bucketName), ws.workspace) diff --git a/server/workspace-service/src/service.ts b/server/workspace-service/src/service.ts index af2fefeab7..4c414128cf 100644 --- a/server/workspace-service/src/service.ts +++ b/server/workspace-service/src/service.ts @@ -177,8 +177,7 @@ export class WorkspaceWorker { void this.exec(async () => { await this.doWorkspaceOperation( ctx.newChild('workspaceOperation', { - workspace: workspace.workspace, - workspaceName: workspace.workspaceName + mode: workspace.mode }), workspace, opt diff --git a/server/workspace-service/src/ws-operations.ts b/server/workspace-service/src/ws-operations.ts index 030cc68307..fa725502b2 100644 --- a/server/workspace-service/src/ws-operations.ts +++ b/server/workspace-service/src/ws-operations.ts @@ -39,7 +39,7 @@ export async function createWorkspace ( ) => Promise, external: boolean = false ): Promise { - const childLogger = ctx.newChild('createWorkspace', {}, { workspace: workspaceInfo.workspace }) + const childLogger = ctx.newChild('createWorkspace', {}, {}) const ctxModellogger: ModelLogger = { log: (msg, data) => { childLogger.info(msg, data) diff --git a/services/ai-bot/pod-ai-bot/src/controller.ts b/services/ai-bot/pod-ai-bot/src/controller.ts index 331c6a0363..b07024efc0 100644 --- a/services/ai-bot/pod-ai-bot/src/controller.ts +++ b/services/ai-bot/pod-ai-bot/src/controller.ts @@ -135,7 +135,7 @@ export class AIControl { token, workspace, this, - this.ctx.newChild(workspace, {}), + this.ctx.newChild('client', {}), info ) } @@ -146,7 +146,7 @@ export class AIControl { token, workspace, this, - this.ctx.newChild(workspace, {}), + this.ctx.newChild('client', {}), info ) }