Skip to content

Allow configurable prefix for MDC keys #3058

Description

@tsurdilo

The SDK writes around 21 MDC keys like WorkflowId, Namespace, TaskQueue, Attempt.
These names aren't configurable.

Ask is for an SDK option to add a prefix to them. Blank by default for backwards
compatibility.

The only workaround today is renaming keys in the logging config, which doesn't fully work:

  • Matches are on key name only. An app that sets its own Namespace key gets that value
    relabelled to temporal.Namespace, even though it didn't come from Temporal.
  • Every key a new SDK release adds — NexusService and NexusOperation, for example — has
    to be added to the rename list by hand, and there's nothing to tell you it's missing.

If possible make this a WorkerFactory setting so it applies to all workers created from it.

One thing to watch: 19 of the keys are constants in LoggerTag, but ReplayWorkflowExecutor
writes "Signals" and "Updates" as string literals. A prefix applied only to LoggerTag
would skip those.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions