diff --git a/components/server/src/server.ts b/components/server/src/server.ts index bccdef9f530194..28e351df2cab2f 100644 --- a/components/server/src/server.ts +++ b/components/server/src/server.ts @@ -144,7 +144,7 @@ export class Server { app.use(async (req: express.Request, res: express.Response, next: express.NextFunction) => { try { const userId = req.user ? req.user.id : undefined; - await runWithContext("http", { userId }, () => next()); + await runWithContext("http", { userId, requestPath: req.path }, () => next()); } catch (err) { next(err); } diff --git a/components/server/src/util/log-context.ts b/components/server/src/util/log-context.ts index 400efcf1f84dea..6307e22568b1d9 100644 --- a/components/server/src/util/log-context.ts +++ b/components/server/src/util/log-context.ts @@ -32,7 +32,7 @@ LogContext.setAugmenter(augmenter); export async function runWithContext( contextKind: string, - context: LogContext & { contextId?: string }, + context: LogContext & { contextId?: string } & any, fun: () => T, ): Promise { return asyncLocalStorage.run( diff --git a/components/server/src/websocket/websocket-connection-manager.ts b/components/server/src/websocket/websocket-connection-manager.ts index 946fee7e328a7b..126992f1520af0 100644 --- a/components/server/src/websocket/websocket-connection-manager.ts +++ b/components/server/src/websocket/websocket-connection-manager.ts @@ -382,6 +382,7 @@ class GitpodJsonRpcProxyFactory extends JsonRpcProxyFactory { userId, contextId: requestId, + method, }, () => { try {