Summary
AkkaLogState defines constants for trace context keys (TraceIdKey, SpanIdKey, TraceFlagsKey) but the Akka metadata keys are hardcoded strings throughout the codebase:
"ActorPath"
"Timestamp"
"Thread"
"LogSource"
These strings appear in:
AkkaLogState.cs (enumerator yield returns)
AkkaLogStateSpecs.cs (multiple test assertions)
Issue701SemanticLoggingRegressionSpecs.cs (AssertMetadata helper)
SemanticLoggingSpecs.cs (inline assertions)
Proposed Change
Add public constants to AkkaLogState matching the existing trace context pattern:
public const string ActorPathKey = "ActorPath";
public const string TimestampKey = "Timestamp";
public const string ThreadKey = "Thread";
public const string LogSourceKey = "LogSource";
Then update the enumerator and all test assertions to reference these constants instead of magic strings. This improves discoverability for downstream consumers who need to read these keys from log state.
Summary
AkkaLogStatedefines constants for trace context keys (TraceIdKey,SpanIdKey,TraceFlagsKey) but the Akka metadata keys are hardcoded strings throughout the codebase:"ActorPath""Timestamp""Thread""LogSource"These strings appear in:
AkkaLogState.cs(enumerator yield returns)AkkaLogStateSpecs.cs(multiple test assertions)Issue701SemanticLoggingRegressionSpecs.cs(AssertMetadata helper)SemanticLoggingSpecs.cs(inline assertions)Proposed Change
Add public constants to
AkkaLogStatematching the existing trace context pattern:Then update the enumerator and all test assertions to reference these constants instead of magic strings. This improves discoverability for downstream consumers who need to read these keys from log state.