Skip to content

dfir_rs: Logging should automatically include tick/loop/stratum counter (via logging/tracing context) #1402

Open
@rohitkulshreshtha

Description

@rohitkulshreshtha

The tick number and current stratum information are helpful for debugging issues in running transducers. It would be ideal if these were logged automatically for log lines logged by hydroflow programs.

It looks like this works currently, but only in particular scenarios. For the log lines to appear, the user must set the global logging level to the same setting as the tracing::instrument (currently TRACE).

So, for example, if your program logs "Received get request" and you run with
RUST_LOG="trace"

RUST_LOG="info,gossip_server::server=trace" cargo test

You would see something like this:

2024-08-19T21:21:44.883674Z TRACE run_tick:run_stratum{tick=530 stratum=0}: gossip_server::server: Received Get request: (Key { namespace: User, table: "table", row_key: "row" }, Address { host: "reader", interface: "client" }).

You would also see a lot of TRACE statements from other parts of the code.

To reduce this noise, if you choose to limit log messages to a specific module:

RUST_LOG="gossip_server::server=trace" cargo test

The tick/stratum information disappears:

2024-08-19T21:23:22.154790Z TRACE gossip_server::server: Received Get request: (Key { namespace: User, table: "table", row_key: "row" }, Address { host: "reader", interface: "client" }).

Continuing to show the tick/stratum information when filtering is enabled will help the user debug production issues more effectively.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions