Skip to content

Put some DRB logs into announce::drb target.#4534

Merged
twittner merged 1 commit into
mainfrom
tw/announce-target
Jun 22, 2026
Merged

Put some DRB logs into announce::drb target.#4534
twittner merged 1 commit into
mainfrom
tw/announce-target

Conversation

@twittner

Copy link
Copy Markdown
Contributor

Also add metric to set the decided leaf view.

Also add metric to set the decided leaf view.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @twittner's task in 1m 45s —— View job


Code Review: Put some DRB logs into announce::drb target

  • Gather context and read changed files
  • Review existing comments
  • Analyze code changes
  • Post review feedback

Summary

Clean PR — the logging improvements in drb.rs are solid: switching from tracing::warn! to structured info! with target: "announce::drb" makes DRB logs filterable and the structured fields (?drb_input, %elapsed_time, etc.) are much more useful than the old format!-based messages. The warninfo level change is appropriate since these are progress messages, not warnings. The new leaf_decided_view gauge is a useful operational metric.

Two minor items flagged as inline comments:

  1. Metric naming (coordinator/metrics.rs:21): leaf_decided_view doesn't follow the coordinator_ prefix convention used by the other metrics in this struct.

  2. Inconsistent target on error/warn (drb.rs:114,183,223): The info! calls got target: "announce::drb" but the error! and warn! calls in the same function still use the default target. If someone filters by announce::drb to monitor DRB progress, they'd miss the error and failure messages — arguably the most important ones.


pub fn new(m: &dyn HotshotMetrics) -> Self {
Self {
timeouts: m.create_counter("coordinator_timeouts".into(), None),
leaf_decided_view: m.create_gauge("leaf_decided_view".into(), None),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: all other metrics in this struct use a coordinator_ prefix (e.g. coordinator_timeouts). Should this be coordinator_leaf_decided_view for consistency and to avoid potential name collisions with gauges registered by other components?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking was that this is a consensus-level metric, not a coordinator-level one.

"We are calculating the DRB result with input {drb_input:?}, but we had \
previously stored {loaded_drb_input:?} with a different difficulty level for \
this epoch. Discarding the value from storage"
error!(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The info! calls in this function were moved to target: "announce::drb", but this error! (and the two warn! calls at lines 183 and 223) still use the default module target. Was this intentional? Errors/warnings here are arguably the most important DRB messages to surface when filtering by announce::drb.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error and warn are expected to be present regardless, the announce target exists specifically to enable less noisy and more ... targeted info messages.

@twittner twittner merged commit 148ff37 into main Jun 22, 2026
161 of 171 checks passed
@twittner twittner deleted the tw/announce-target branch June 22, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants