Skip to content

Conversation

@julienrbrt
Copy link
Member

Overview

ref: #2896 (comment)

Cleanup and remove confusing (and unused) metrics

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedDec 3, 2025, 12:13 PM

@claude
Copy link
Contributor

claude bot commented Dec 2, 2025

Claude finished @julienrbrt's task —— View job


Changelog Entry Already Present ✓

I've checked the repository and the changelog entry has already been successfully added to this PR!

Current Status:

  • Check current state of CHANGELOG.md
  • Verify if changelog entry exists
  • Confirm PR merge status

Findings:

The changelog entry for PR #2904 is already present in CHANGELOG.md at line 39 under the "Removed" section for v1.0.0-beta.10:

### Removed

- **BREAKING:** Removed unused and confusing metrics from sequencers and block processing, including sequencer-specific metrics (gas price, blob size, transaction status, pending blocks), channel buffer metrics, overly granular error metrics, block production categorization metrics, and sync lag metrics. Essential metrics for DA submission health, block production, and performance monitoring are retained. [#2904](https://github.com/evstack/ev-node/pull/2904)

The PR has been successfully merged into main (commit f1e677d), and the changelog entry is included in that merge. No further action is needed!


@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a comprehensive cleanup and refactoring of the system's metrics. It systematically removes a significant number of metrics identified as either confusing or unused, particularly those related to the single sequencer and various block processing aspects. The changes aim to streamline the monitoring infrastructure by focusing on essential data points, thereby reducing complexity and maintenance overhead.

Highlights

  • Sequencer Metrics Deprecation: All dedicated metrics for the single sequencer, including gas price, blob size, transaction status, pending blocks, and included block height, have been completely removed. This involved deleting the sequencers/single/metrics.go file and removing all associated metric handling from the Sequencer struct and its constructors.
  • Extensive Block Metrics Pruning: A wide array of block-related metrics, such as those for channel buffer usage, various error types, goroutine count, DA submission attempts, synchronization status, block production details (time, empty/lazy/normal blocks), and state transitions, have been removed from the common block metrics definition in block/internal/common/metrics.go.
  • Streamlined Metric Recording Logic: The recordBlockMetrics function has been updated to accept the newState and now centralizes the recording of the Height and TxsPerBlock metrics, reflecting the refined set of essential data points.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request does a great job of cleaning up and simplifying the metrics, especially by removing the now-unused metrics from the single sequencer. The changes in the block package also help consolidate metric reporting. I have one suggestion to further reduce potential confusion by removing a redundant metric.

Comment on lines +651 to 663
func (e *Executor) recordBlockMetrics(newState types.State, data *types.Data) {
e.metrics.Height.Set(float64(newState.LastBlockHeight))

if data == nil || data.Metadata == nil {
return
}

e.metrics.NumTxs.Set(float64(len(data.Txs)))
e.metrics.TotalTxs.Add(float64(len(data.Txs)))
e.metrics.TxsPerBlock.Observe(float64(len(data.Txs)))
e.metrics.BlockSizeBytes.Set(float64(data.Size()))
e.metrics.CommittedHeight.Set(float64(data.Metadata.Height))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The Height metric appears to be redundant with the CommittedHeight metric. Both are set to the same value, as newState.LastBlockHeight and data.Metadata.Height will be identical for a newly produced block. The Prometheus name for CommittedHeight is latest_block_height, which is quite descriptive.

To align with the goal of this PR to clean up metrics and reduce confusion, I suggest removing the Height metric altogether. This would also simplify the code changes in this PR.

This suggestion removes the Height metric update and reverts the function signature. You would also need to:

  1. Remove the Height field from the common.Metrics struct in block/internal/common/metrics.go.
  2. Remove its initialization in PrometheusMetrics and NopMetrics in the same file.
  3. Update the call at line 429 to e.recordBlockMetrics(data).
  4. Update tests in block/internal/common/metrics_test.go to remove checks for the Height metric.
func (e *Executor) recordBlockMetrics(data *types.Data) {
	if data == nil || data.Metadata == nil {
		return
	}

	e.metrics.NumTxs.Set(float64(len(data.Txs)))
	e.metrics.TotalTxs.Add(float64(len(data.Txs)))
	e.metrics.TxsPerBlock.Observe(float64(len(data.Txs)))
	e.metrics.BlockSizeBytes.Set(float64(data.Size()))
	e.metrics.CommittedHeight.Set(float64(data.Metadata.Height))
}

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.53%. Comparing base (474818d) to head (08cb5c6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2904      +/-   ##
==========================================
- Coverage   64.63%   64.53%   -0.10%     
==========================================
  Files          81       81              
  Lines        7382     7370      -12     
==========================================
- Hits         4771     4756      -15     
- Misses       2069     2072       +3     
  Partials      542      542              
Flag Coverage Δ
combined 64.53% <100.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tac0turtle
tac0turtle previously approved these changes Dec 2, 2025
@tac0turtle
Copy link
Contributor

we should add a changelog as well

@tac0turtle
Copy link
Contributor

@claude can you add a changelog to this pr

@claude
Copy link
Contributor

claude bot commented Dec 3, 2025

Claude finished @tac0turtle's task —— View job


Changelog Entry Added ✓

I've successfully created a changelog entry for this metrics cleanup PR. However, I encountered a permissions issue when trying to push the changes to the remote repository.

What I did:

  • Found and read the existing changelog file
  • Understood the changelog format
  • Added entry for metrics cleanup changes under the "Removed" section
  • Committed the changes locally

Changelog Entry Added:

### Removed

- Removed unused and confusing metrics from sequencers and block processing, including sequencer-specific metrics (gas price, blob size, transaction status, pending blocks), channel buffer metrics, overly granular error metrics, block production categorization metrics, and sync lag metrics. Essential metrics for DA submission health, block production, and performance monitoring are retained. [#2904](https://github.com/evstack/ev-node/pull/2904)

Issue:
I don't have permission to push to the repository. The commit has been created locally with the message:

docs: add changelog entry for metrics cleanup

Co-authored-by: Marko <[email protected]>

Next Steps:
Someone with push access will need to either:

  1. Pull my local commit and push it, or
  2. Manually add the changelog entry shown above to CHANGELOG.md under the ## [Unreleased] section in a new ### Removed subsection

The changelog entry summarizes the removal of unused metrics while highlighting that essential observability metrics are retained, which aligns with the PR's goal of cleaning up confusing and unused metrics.


@tac0turtle tac0turtle merged commit f1e677d into main Dec 3, 2025
13 of 17 checks passed
@tac0turtle tac0turtle deleted the julien/metrics-seq branch December 3, 2025 12:13
@julienrbrt
Copy link
Member Author

Oops, didn't see that notification.

alpe added a commit that referenced this pull request Dec 8, 2025
* main:
  refactor(sequencers): persist prepended batch (#2907)
  feat(evm): add force inclusion command (#2888)
  feat: DA client, remove interface part 1: copy subset of types needed for the client using blob rpc. (#2905)
  feat: forced inclusion (#2797)
  fix: fix and cleanup metrics (sequencers + block) (#2904)
  build(deps): Bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /docs in the npm_and_yarn group across 1 directory (#2900)
  refactor(block): centralize timeout in client (#2903)
  build(deps): Bump the all-go group across 2 directories with 3 updates (#2898)
  chore: bump default timeout (#2902)
  fix: revert default db (#2897)
  refactor: remove obsolete // +build tag (#2899)
  fix:da visualiser namespace  (#2895)
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.

3 participants