temporalio / temporalio/sdk-java
Allow configurable prefix for MDC keys
@maciejdudko is already working on this.
Since Sep 8, 2026.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
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
Namespacekey gets that value
relabelled totemporal.Namespace, even though it didn't come from Temporal. - Every key a new SDK release adds —
NexusServiceandNexusOperation, 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.