-
Notifications
You must be signed in to change notification settings - Fork 23
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
Relayer metrics #515
base: develop
Are you sure you want to change the base?
Relayer metrics #515
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use
gauge
for non-monotonic metrics (ids, lengths, etc.). Otherwise Prometheus will consider it as metric reset. - Just an idea, you can use histogram for response time and response code for RPC calls, as it is in
actix-web-prometheus
crate.
relayer/src/metrics/ethereum.rs
Outdated
let beefy = self.beefy.map(|x| BeefyLightClient::new(x, client.inner())); | ||
let inbound = self.beefy.map(|x| InboundChannel::new(x, client.inner())); | ||
let outbound = self.beefy.map(|x| OutboundChannel::new(x, client.inner())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let beefy = self.beefy.map(|x| BeefyLightClient::new(x, client.inner())); | |
let inbound = self.beefy.map(|x| InboundChannel::new(x, client.inner())); | |
let outbound = self.beefy.map(|x| OutboundChannel::new(x, client.inner())); | |
let beefy = self.beefy.map(|x| BeefyLightClient::new(x, client.inner())); | |
let inbound = self.inbound.map(|x| InboundChannel::new(x, client.inner())); | |
let outbound = self.outbound.map(|x| OutboundChannel::new(x, client.inner())); |
Typo?
relayer/src/cli/mod.rs
Outdated
if self.enable_metrics { | ||
let mut builder = metrics_exporter_prometheus::PrometheusBuilder::new(); | ||
if let Some(address) = &self.prometheus_address { | ||
builder = builder.with_http_listener(address.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder = builder.with_http_listener(address.clone()); | |
builder = builder.with_http_listener(*address); |
relayer/src/metrics/ethereum.rs
Outdated
metrics::absolute_counter!(ETH_OUTBOUND_NONCE, nonce, labels); | ||
} | ||
let block_number = self.client.get_block_number().await?.as_u64(); | ||
metrics::counter!(ETH_BLOCK_NUMBER, block_number, labels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metrics::counter!(ETH_BLOCK_NUMBER, block_number, labels); | |
metrics::absolute_counter!(ETH_BLOCK_NUMBER, block_number, labels); |
Set an absolute value, not increment.
relayer/src/metrics/para.rs
Outdated
vset.id, | ||
labels | ||
); | ||
metrics::absolute_counter!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counter is a monotonic value, but as I understand, the next length might be less than current. Consider gauge
type for the metric.
relayer/src/metrics/para.rs
Outdated
.beefy_light_client() | ||
.current_validator_set(network_id); | ||
self.update_metric(&address, block_hash, |vset| { | ||
metrics::absolute_counter!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id the ID is not a monotonic, consider gauge
type.
relayer/src/metrics/sora.rs
Outdated
metrics::absolute_counter!(SUB_BEEFY_CURRENT_ID, vset.id); | ||
metrics::absolute_counter!(SUB_BEEFY_CURRENT_LEN, vset.len as u64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ID and length is not a monotonic, consider gauge
.
relayer/src/metrics/ethereum.rs
Outdated
metrics::absolute_counter!(ETH_BEEFY_LATEST_BLOCK, latest_block, labels); | ||
} | ||
if let Some(contract) = &self.inbound { | ||
let nonce: u64 = contract.nonce().call().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let nonce: u64 = contract.nonce().call().await?; | |
let nonce: u64 = contract.batch_nonce().call().await?; |
It is batch_nonce
in develop
in InboundChannel.sol
# Conflicts: # Cargo.lock # relayer/src/cli/bridge/relay/sora/evm.rs # relayer/src/substrate/mod.rs
@vovac12 can we merge and close this ? |
Patch relayer metrics
No description provided.