Hi everyone,
I’m working with Temporal and have two questions regarding timers and logging:
-
Is there a way to assign custom, human-readable names to timers (created via Workflow.newTimer or Workflow.await) so that these names appear on the Temporal Web UI Timeline?
Currently, I only see system-generated timer IDs, which makes it hard to understand their purpose.
-
Is it possible to create logs or events within a workflow that show up directly on the Timeline in the Temporal UI?
I noticed that Workflow.getLogger().info(…) adds logs to the workflow history, but they don’t appear as separate, visual entries on the Timeline.
I’d appreciate any advice or confirmation whether these features exist or if it makes sense to submit a feature request.
Thanks in advance!
Hi,
for 1) you can use the summary option
Workflow.newTimer(Duration.ofSeconds(2), TimerOptions.newBuilder().setSummary("my-timer").build())
Workflow.await
does not have it
2 ) Workflow.getLogger()
return a logger instance which is replay aware by default Observability - Java SDK | Temporal Platform Documentation.
The workflow history contains events (activities, timers etc… ) so the workflow state can be recover at any point of time, recording logs is outside the scope. Can you share what information you need to log? I know that users sometimes use sideEffect and LocalActivities for this purpose but I don’t think it is a good idea.
Antonio
Hi Antonio,
Thanks for clarifying point 1 – the TimerOptions.setSummary() approach is exactly what I was looking for. It works perfectly for creating named timers.
Regarding 2, maybe I didn’t explain my use case clearly.
What I meant was not regular logging (I understand that Workflow.getLogger() is replay-aware and logs go to the worker logs). I was thinking about something like custom annotations or markers that would appear as visual entries on the Temporal Web UI Timeline, similar to activities or timer events, to make the workflow execution easier to inspect.
Is there currently any mechanism for that?
Thanks again!
Hi
I was thinking about something like custom annotations or markers that would appear as visual entries on the Temporal Web UI Timeline,
there is nothing currently, can you share the information you want to display in the UI?. I know some users use sideEffect and LocalActivities for this purpose, but they are not intended for that
Antonio
Hi,
The type of information I’d like to display on the Timeline is mostly:
-
Business-level checkpoints, like “Waiting for external order to start”, “Retry #3”, “Workflow entered compensation phase”
-
Decision points, e.g., “Skipped activity because X condition was met”
-
Custom progress markers to make it easier for ops/QA to quickly inspect where a workflow is in its lifecycle without reading the full text history.