انتقل إلى المحتوى الرئيسي

Interface: CorrelationContext

Defined in: packages/common/src/correlation.ts:11

What every log line, error reply and outbound message carries for one causal chain. Chapter 11: one id from the gateway, through every service, into jobs.

Properties​

causationId?​

readonly optional causationId?: string

Defined in: packages/common/src/correlation.ts:19

The id of the message being handled, so a call made while handling it names it as its cause (02, correlation and context). Set by the receiver on entry to a handler, never by enrichContext: a handler cannot rewrite its own cause.


correlationId​

readonly correlationId: string

Defined in: packages/common/src/correlation.ts:13

Constant for the whole causal chain (chapter 29).


tenantId?​

readonly optional tenantId?: string

Defined in: packages/common/src/correlation.ts:21

The tenant the work is for, once known. Never a secret.


traceId?​

readonly optional traceId?: string

Defined in: packages/common/src/correlation.ts:23

W3C trace id. Slice 1 populates it; the field exists so log shape does not change.