Skip to content

interface bss-core metrics to allow for driver-specific metrics extensions#2235

Merged
mslipper merged 2 commits intoethereum-optimism:developfrom
cfromknecht:bsscore-iface-metrics
Feb 28, 2022
Merged

interface bss-core metrics to allow for driver-specific metrics extensions#2235
mslipper merged 2 commits intoethereum-optimism:developfrom
cfromknecht:bsscore-iface-metrics

Conversation

@cfromknecht
Copy link
Contributor

@cfromknecht cfromknecht commented Feb 25, 2022

Description
Modifies the bss-core Service to operate on a metrics.Metrics interface rather than a concrete struct.
The interface is now implemented by metrics.Base which can embedded in driver-specific metrics extensions.
Some extra functionality is added to make this process simpler, e.g exposing the SubsystemName() to ensure the extensions all have the same metrics prefix. To demonstrate the behavior, the BatchPruneCount metrics is moved into an extended metrics object specific to the sequencer, since the proposer does not have this concept.

Metadata

  • Fixes ENG-1969

The core metrics can still reside within the bss-core package, but now
drivers can extend the base object with additional metrics.
@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2022

🦋 Changeset detected

Latest commit: 87359fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/batch-submitter-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cfromknecht cfromknecht mentioned this pull request Feb 25, 2022
4 tasks
@cfromknecht cfromknecht force-pushed the bsscore-iface-metrics branch from b59734c to a3baeb8 Compare February 25, 2022 20:58
The BatchPruneCount metric is not used by the proposer, so this is moved
into he sequencer's extended metrics. Also adds additional tooling for
extending metrics.

import "github.com/prometheus/client_golang/prometheus"

type Metrics interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these don't make much sense for the teleportr service, I think its going to be hard to define a perfectly abstract interface that could be used for metrics across all the services

// submission.
NumElementsPerBatch() prometheus.Summary

// SubmissionTimestamp tracks the time at which each batch was confirmed.
Copy link
Contributor

Choose a reason for hiding this comment

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

batch -> transaction

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think batch is still accurate? We do have support for batched withdrawals. IMO "batch" is still correct, even in the degenerate case of 1 element

SubmissionGasUsedWei() prometheus.Gauge

// BatchsSubmitted tracks the total number of successful batch submissions.
BatchesSubmitted() prometheus.Counter
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be transactions sent? and failed transactions?

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2022

Codecov Report

Merging #2235 (b59734c) into develop (dde4543) will not change coverage.
The diff coverage is n/a.

❗ Current head b59734c differs from pull request most recent head 87359fd. Consider uploading reports for the commit 87359fd to get more accurate results

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2235   +/-   ##
========================================
  Coverage    73.04%   73.04%           
========================================
  Files           86       86           
  Lines         2846     2846           
  Branches       486      486           
========================================
  Hits          2079     2079           
  Misses         767      767           
Flag Coverage Δ
batch-submitter 62.63% <ø> (ø)
contracts 90.88% <ø> (ø)
core-utils 87.80% <ø> (ø)
data-transport-layer 36.89% <ø> (ø)
sdk 57.71% <ø> (ø)

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


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dde4543...87359fd. Read the comment docs.

@tynes
Copy link
Contributor

tynes commented Feb 25, 2022

Generally looks good to me except for the need to decide on whether or not the Metrics will be/should be the defacto way to collect metrics across all the go services going into the future

Copy link
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

Looks good to me, ignore the comments re: generalizing it too much

@mslipper mslipper merged commit bdb8de1 into ethereum-optimism:develop Feb 28, 2022
theochap pushed a commit that referenced this pull request Dec 10, 2025
Fixes #2229

---------

Co-authored-by: refcell <abigger87@gmail.com>
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.

4 participants