Skip to content

Separating logging from tracing #607

Closed

Description

@thanethomson

At present, our logs are somewhat problematic in that they don't provide a lot of value to operators, and they simultaneously don't provide a lot of value to our team. It appears as though the logs have a mix of target audiences: mostly core developers, but secondarily operators.

One option is to use different log levels to output different kinds of information (e.g. operator-focused logs from info level, but developer-focused logs at debug level).

My alternative proposal here is to totally separate the logging/tracing output for each of these audiences:

  1. Let logs exclusively target operators, providing them with actionable insights into what's going on in the system, especially if there are failures that require operator intervention to recover from.
  2. Introduce traces - a human- and machine-readable output format that is turned off by default, and provides far more detailed/fine-grained information, when turned on, to:
    1. Allow core developers to more easily troubleshoot systems under test or even systems in production.
    2. Potentially help facilitate model-based testing via our E2E tests, since these traces could potentially be machine-readable.

The specific trace format that @josef-widder recommended looking into here is Informal Trace Format (cc @konnov, @shonfeder). Traces could be exposed either by way of special trace JSON files, or via some form of streaming RPC/gRPC endpoint. We already have an ITF parser written in Rust here: https://github.com/informalsystems/itf-rs

If this would potentially be a reasonable solution to help us understand the system better under different conditions, then the first deliverable here would be an ADR describing the solution in more detail, as well as a PoC implementation (perhaps starting with traces for the consensus and/or mempool reactors' operations).

Activity

  1. added
    enhancement
    P:operator-experience
    logs
    on Mar 28, 2023
  2. hvanz commented on Mar 30, 2023

    @hvanz
    Collaborator

    For reference, extracting traces from execution logs for doing model-based testing is sometimes called Model-Based
    Trace-Checking (MBTC), as in the paper eXtreme Modelling in Practice.

  3. self-assigned this
    on May 18, 2023
  4. lasarojc commented on Jun 16, 2023

    @lasarojc
    Contributor

    Hypothesis: using ITF to capture comet's state evolution would be useful in debugging.

    Had a brief chat with @konnov and @josef-widder regarding this and here are some notes:

    • ITF is probably too verbose for tracing.
      • Even if we use an incremental approach to capturing the state and some tool to rehydrate this to a full ITF, it would still be too verbose
    • ITF is probably too heavy to frequently capture state on a working system
      • Capturing state to output in the trace would contend with other tasks
    • Capturing state is likely overkill and instead what we would want is to capture transitions of the state machine
      • Transition trace could be checked against Quint/Apalache, for example by transforming it to a Quint test.
      • Existing tooling cannot handle this
      • Specifications are done at different levels and somehow the traces would have to match these levels

    Conclusions (mine):

    • we need to come up with guidelines on how to write logs so that they are more useful, which is hard since usefulness varies depending on the context; being ITF compliant is not the right way.
    • we should approach MBTC carefully since there are examples of it being not useful (See @hvanz previous comment)
  5. thanethomson commented on Jun 16, 2023

    @thanethomson
    ContributorAuthor

    Thanks for looking into this @lasarojc! Would it be safe to say then that we can close this issue and instead open issues relating to the types of logs that we and operators (as two separate groups of users) want from each of the primary modules in the system?

    If we're going the route of creating GitHub issues to improve logging, I'd recommend creating separate issues for each module, where in each issue we capture what's most important to be output for consensus engine developers, and what's most important to be logged for operators. We could track these by adding the P:observability and logs labels.

  6. added
    P:consensus-engine-devs
    and removed on Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P:consensus-engine-devsP:operator-experienceenhancementlogs

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions