Allow configurable prefix for MDC keys

Open
#3,058 0 comments 0 reactions 1 assignee View on GitHub

@maciejdudko is already working on this.

Since Sep 8, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement

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.

Dominant language
Java
Stars
433
Forks
249
Avg merge
6d 5h
Merged PRs (30d)
25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from temporalio/sdk-java

All issues in temporalio/sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.