Skip to content

Define constants for AkkaLogState metadata keys (ActorPath, Timestamp, Thread, LogSource) #722

Description

@Aaronontheweb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions