Skip to content

Commit 77467f1

Browse files
committed
fix: include tenant ID when logging with JSON format
1 parent f86a7a8 commit 77467f1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/runtime/runtime.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class Runtime {
6767
await this.runWithInvokeContext(
6868
context.awsRequestId,
6969
context.xRayTraceId,
70+
context.tenantId,
7071
() => processor.processInvoke(context, event),
7172
);
7273
}
@@ -82,6 +83,7 @@ export class Runtime {
8283
await this.runWithInvokeContext(
8384
context.awsRequestId,
8485
context.xRayTraceId,
86+
context.tenantId,
8587
() => processor.processInvoke(context, event),
8688
);
8789
});
@@ -91,13 +93,15 @@ export class Runtime {
9193
private async runWithInvokeContext(
9294
requestId: string,
9395
xRayTraceId: string | undefined,
96+
tenantId: string | undefined,
9497
fn: () => Promise<void>,
9598
): Promise<void> {
9699
const invokeStore = await InvokeStore.getInstanceAsync();
97100
return invokeStore.run(
98101
{
99102
[InvokeStoreBase.PROTECTED_KEYS.REQUEST_ID]: requestId,
100103
[InvokeStoreBase.PROTECTED_KEYS.X_RAY_TRACE_ID]: xRayTraceId,
104+
[InvokeStoreBase.PROTECTED_KEYS.TENANT_ID]: tenantId,
101105
},
102106
fn,
103107
);

0 commit comments

Comments
 (0)