Summary
Add a small, reusable ICorrelationIdGenerator that produces correlation identifiers, with TimeProvider injection for deterministic unit tests.
Goal
Give IContext implementations a clean supported way to mint CorrelationId (used by header propagation and logging) without each app reinvent the format.
Problem
Propagation examples hand-write X-Correlation-Id values ad hoc. There is no uniform generator, so formats differ across services, which breaks 1.1 header correlation and 1.2 trace correlation on the wire.
Scope
Design Expectations
Acceptance Criteria
Non-Goals
Summary
Add a small, reusable
ICorrelationIdGeneratorthat produces correlation identifiers, withTimeProviderinjection for deterministic unit tests.Goal
Give
IContextimplementations a clean supported way to mintCorrelationId(used by header propagation and logging) without each app reinvent the format.Problem
Propagation examples hand-write
X-Correlation-Idvalues ad hoc. There is no uniform generator, so formats differ across services, which breaks 1.1 header correlation and 1.2 trace correlation on the wire.Scope
ICorrelationIdGeneratorabstraction.TimeProviderfor deterministic tests.CorrelationContextsample that takes the generator and setsCorrelationId = generator.Next().TimeProvider-driven determinism.Design Expectations
TimeProviderinjection per the Category 6 determinism rule.Acceptance Criteria
TimeProvideris substituted.Non-Goals