Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch to metrics_derive #832

Merged
merged 4 commits into from
Oct 11, 2024
Merged

feat: switch to metrics_derive #832

merged 4 commits into from
Oct 11, 2024

Conversation

andysim3d
Copy link
Collaborator

@andysim3d andysim3d commented Oct 8, 2024

[Closes/Fixes] #166

Proposed Changes

@andysim3d andysim3d changed the title Andy/metric derive feat: switch to metrics_derive Oct 8, 2024
@andysim3d andysim3d force-pushed the andy/metric-derive branch 2 times, most recently from d07ebca to 298870f Compare October 9, 2024 00:54
bin/rundler/Cargo.toml Outdated Show resolved Hide resolved
crates/pool/src/chain.rs Outdated Show resolved Hide resolved
crates/pool/src/chain.rs Outdated Show resolved Hide resolved
Comment on lines 710 to 732
#[derive(Metrics)]
#[metrics(scope = "op_pool")]
struct UoPoolMetricsEPSpecific {
#[metric(describe = "the number of ops seen.")]
ops_seen: Gauge,
#[metric(describe = "the number of unmined ops.")]
unmined_operations: Counter,
#[metric(describe = "the number of removed ops.")]
removed_operations: Counter,
#[metric(describe = "the number of removed entities.")]
removed_entities: Counter,
}

fn current_base_fee(fee: f64) {
metrics::gauge!("op_pool_current_base_fee").set(fee);
}
#[derive(Metrics)]
#[metrics(scope = "op_pool")]
struct UoPoolMetrics {
#[metric(describe = "the maximum fee in Gwei.")]
current_max_fee_gwei: Gauge,
#[metric(describe = "the maximum priority fee in Gwei.")]
current_max_priority_fee_gwei: Gauge,
#[metric(describe = "the base fee of current block.")]
current_base_fee: Gauge,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about simplifying this into a single struct and just handling the duplication of the fees in dashboards?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that might confuse who don't familiar the metric setup. they might find the value doubled (for 2 EPs we supportted.)

Copy link
Collaborator

@dancoombs dancoombs left a comment

Choose a reason for hiding this comment

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

🚢

@andysim3d andysim3d merged commit 2287fb4 into feat/v0.4 Oct 11, 2024
8 checks passed
@andysim3d andysim3d deleted the andy/metric-derive branch October 11, 2024 17:57
dancoombs pushed a commit that referenced this pull request Oct 18, 2024
dancoombs pushed a commit that referenced this pull request Oct 23, 2024
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