modality log

Command: modality log

Print a linear, git-style log view of a trace. This view shows a graphical representation of the trace where every vertical line is a timeline (unless specified otherwise with the --lane-grouping option) and communication between timelines is shown with arrows.

Extra information is printed next to the graph for each event. By default this information consists of event and timeline name, coordinates (colon-separated hex strings which constitute a unique ID for an instance of an event), and all event attributes besides those in the internal namespace. You can control which attributes are printed for each event with the options detailed below.

# Example

$ modality log
─╮                           [Interaction i0000] Producer sampled raw measurement @ producer   [529ff41dc3b24683952293e001effa66:b9ab]
                        name = Producer sampled raw measurement
                        sample = 0
                        severity = info
                        source.file = tracing-modality/examples/monitored_pipeline.rs
                        source.line = 219
                        source.module = monitored_pipeline::producer
                        timestamp = 1657324701508756168ns
                     
───╮                         [Interaction i0001] Producer sending measurement message @ producer   [529ff41dc3b24683952293e001effa66:babe]
 │ │                           destination = consumer
 │ │                           name = Producer sending measurement message
 │ │                           sample = 0
 │ │                           severity = info
 │ │                           source.file = tracing-modality/examples/monitored_pipeline.rs
 │ │                           source.line = 242
 │ │                           source.module = monitored_pipeline::producer
 │ │                           timestamp = 1657324701509024985ns
 │ │                        
 │ │                         Sending heartbeat measurement message @ producer   [529ff41dc3b24683952293e001effa66:bbc0]
 │ │                           destination = monitor
 │ │                           name = Sending heartbeat measurement message
 │ │                           severity = info
 │ │                           source.file = tracing-modality/examples/monitored_pipeline.rs
 │ │                           source.line = 416
 │ │                           source.module = monitored_pipeline
 │ │                           timestamp = 1657324701509287700ns
 │ │                        
 │ ╰──▶                      [Interaction i0001] Received heartbeat message @ monitor   [16d44f324af8466fab82b667f228bd53:bca5]
                        interaction.remote_timeline_id = 529ff41d-c3b2-4683-9522-93e001effa66
                        interaction.remote_timestamp = 1657324701509228153ns
                        name = Received heartbeat message
                        severity = info
                        source = producer
                        source.file = tracing-modality/examples/monitored_pipeline.rs
                        source.line = 361
                        source.module = monitored_pipeline::monitor
                        timestamp = 1657324701509578468ns
                     
 ╰────────────▶               [Interaction i0000] Received measurement message @ consumer   [1a4caa1f08c940a9bce3ba833de8cf32:bcc1]
                               interaction.remote_timeline_id = 529ff41d-c3b2-4683-9522-93e001effa66
                               interaction.remote_timestamp = 1657324701508966525ns
                               name = Received measurement message
                               sample = 0
                               severity = info
                               source.file = tracing-modality/examples/monitored_pipeline.rs
                               source.line = 297
                               source.module = monitored_pipeline::consumer
                               timestamp = 1657324701509662659ns
...

$ modality log --short
─╮                           [Interaction i0000] Producer sampled raw measurement @ producer   [529ff41dc3b24683952293e001effa66:b9ab]
───╮                         [Interaction i0001] Producer sending measurement message @ producer   [529ff41dc3b24683952293e001effa66:babe]
 │ │                         Sending heartbeat measurement message @ producer   [529ff41dc3b24683952293e001effa66:bbc0]
 │ ╰──▶                      [Interaction i0001] Received heartbeat message @ monitor   [16d44f324af8466fab82b667f228bd53:bca5]
 ╰────────────▶               [Interaction i0000] Received measurement message @ consumer   [1a4caa1f08c940a9bce3ba833de8cf32:bcc1]
                             Monitor has observed a component for the first time for that component @ monitor   [16d44f324af8466fab82b667f228bd53:bd75]
─╮                           [Interaction i0002] Producer sampled raw measurement @ producer   [529ff41dc3b24683952293e001effa66:02457e]
                      Producer sending measurement message @ producer   [529ff41dc3b24683952293e001effa66:024730]
 ╰────────────▶               [Interaction i0002] Received measurement message @ consumer   [1a4caa1f08c940a9bce3ba833de8cf32:024a08]
─╮                           [Interaction i0003] Producer sampled raw measurement @ producer   [529ff41dc3b24683952293e001effa66:03dbff]
                      Producer sending measurement message @ producer   [529ff41dc3b24683952293e001effa66:03dcf6]
 ╰────────────▶               [Interaction i0003] Received measurement message @ consumer   [1a4caa1f08c940a9bce3ba833de8cf32:03de27]

# Options

--around <around> - Display the log around (before and after) this trace event, given as an event coordinate. You can specify how much of the surrounding log to print with --radius.

--attributes <attributes> - Only show attributes that match one of the patterns in the given comma-separated list of attribute key patterns.

--color <always | never | auto> - Whether to color the output. Default is auto, which will autodetect the target output location and whether or not it is capable of handling color escape codes.

-f, --format <text | json> - The printed output format. Defaults to text.

--from <from> - Display the log starting at this trace event, given as an event coordinate.

--global - Show events from Modality's entire database. If this flag is not present events are limited to those visible from the current segment(s) of the current workspace. May not be used with --latest-segment, --segment, --segmentation-rule, or --whole-workspace.

--lane-grouping <lane-grouping> - An ordered list of timeline attribute keys used to group the presented log-lanes. If not specified, the lane grouping will be by timeline-name.

--latest-segment - Limit data to the single most recent segment (i.e. the segment which has most recently received an event or timeline attribute update) rather than the current default segment(s). The latest segment is automatically updated as new data are received. May not be used with --global, --segment, --segmentation-rule, or --whole-workspace.

--radius <radius> - Display this many trace events before and after the target trace event, which must be set using --around.

--segment <segment pattern>... - Limit data to the given segment(s) rather than the current default segment(s). Accepts one or more segment name patterns, which can include * or ? as wildcards in the style of glob. May not be used with --global, --latest-segment, or --whole-workspace.

--segmentation-rule <segmentation rule pattern>... - Limit data to segments produced by the given segmentation rule(s) rather than the current default segment(s). Accepts one or more segmentation rule name patterns, which can include * or ? as wildcards in the style of glob. May not be used with --global, --latest-segment, or --whole-workspace.

--short - Print a condensed view of the graph, omitting event attributes. This view is especially useful for tracking the interactions in the graph.

--show-internal - Include internal attributes (i.e. attributes with names prefixed with internal.) in the output.

--timeline-filter <timeline filter> - A timeline filter expression to restrict the output to events from timelines that match the filter.

--to <to> - Display the log up until this trace event, given as an event coordinate.

-v, --verbose - Print verbose debugging information.

--with-timeline-attributes - Display all related timeline attributes for each event.

--whole-workspace - Limit data to the workspace as a monolithic whole unit, ignoring the default segment(s). May not be used with --global, --latest-segment, --segment, or --segmentation-rule.

--workspace-name <workspace-name> - Name of the workspace to display data for. If not specified the current default workspace (set with modality workspace use) will be used.