-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersinput welcomeLooking for feedback or ideasLooking for feedback or ideaspull requests welcomeLooking for PRsLooking for PRs
Description
When you have multiple levels of tracing telemere's default console logger prints them in the order they are started, which results in traces printing in the reverse order they appear in source code. Maybe telemere could provide a buffering handler that could print traces in a waterfall like how tools such as Jaeger print nested spans in traces?
Here's some code I just wrote:
(defn receive [ctx req]
(tel/trace!
::receive-command
(let [command (prepare-command req)
res (validate-command req command)]
(tel/trace!
{:id ::validated-command
:data res}
(if (:valid? res)
(let [execution (process-command ctx (:state req) command)]
(tel/trace!
{:id ::executed-command
:data execution}
(if (:execution/success? execution)
(:execution/result execution)
(render-error req 500))))
(render-error req (:status res)))))))This prints like so:
14:59:49 INFO TRACE pairsmith.commands[97,6] ::executed-command ...
14:59:49 INFO TRACE pairsmith.commands[97,6] ::validated-command ...
14:59:49 INFO TRACE pairsmith.commands[93,3] ::receive-command ...
I'd like them to print something like this:
14:59:49 INFO TRACE pairsmith.commands[93,3] ::receive-command ...
14:59:49 INFO TRACE pairsmith.commands[97,6] ::validated-command ...
14:59:49 INFO TRACE pairsmith.commands[97,6] ::executed-command ...
I'm not exactly sure about the details - e.g. where to indent etc, but seeing them in the order they appear in the code would be helpful, and some visual clues that they are part of the same flow would also be nice.
ptaoussanis
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersinput welcomeLooking for feedback or ideasLooking for feedback or ideaspull requests welcomeLooking for PRsLooking for PRs