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

More Metrics #495

Merged
merged 45 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fdbb57e
metrics refactoring
mattiekat May 12, 2022
c2d0fa0
metrics refactoring
mattiekat May 12, 2022
b19c40b
Make brain hurt less by using a damn function
mattiekat May 12, 2022
2464b3b
patch through metrics to abacus_ethereum inbox and outbox
mattiekat May 12, 2022
3a94c67
WIP
mattiekat May 13, 2022
d31ecc4
Minor cleanup
mattiekat May 13, 2022
589091c
Merge branch 'main' into mattie/metrics
mattiekat May 13, 2022
fb1f907
work on time update
mattiekat May 17, 2022
156cf98
added label arrays
mattiekat May 17, 2022
31730e9
refactoring
mattiekat May 17, 2022
866f20e
Metrics for sending txns
mattiekat May 17, 2022
7b8e545
Metrics middleware
mattiekat May 19, 2022
af0e2e9
cleanup
mattiekat May 19, 2022
24144cf
Merge branch 'main' into mattie/metrics
mattiekat May 20, 2022
e2376d3
Cleanup after merge
mattiekat May 20, 2022
d8b02c8
Add metrics config and setup prom metrics with core metrics
mattiekat May 23, 2022
5ed42b5
Minor fixes to docs
mattiekat May 23, 2022
81afd32
Better trait building
mattiekat May 23, 2022
8394727
rename
mattiekat May 23, 2022
83b8488
Weave metrics through code
mattiekat May 24, 2022
36845d1
Use core metrics instead
mattiekat May 24, 2022
c691b92
Removed some unused code
mattiekat May 24, 2022
4942935
fmt
mattiekat May 24, 2022
dbfdbb5
change feature layout
mattiekat May 24, 2022
b95d7cb
fix docker build
mattiekat May 24, 2022
cc9d110
Start scraping metrics on an interval
mattiekat May 25, 2022
b30816b
Merge branch 'main' into mattie/metrics
mattiekat May 25, 2022
f8e25ff
fmt
mattiekat May 25, 2022
255b273
fix duplicate label error
mattiekat May 25, 2022
8138672
change features
mattiekat May 26, 2022
783b360
fix u256 conversion fn
mattiekat May 26, 2022
a7cfec8
refactor
mattiekat May 26, 2022
904dc4b
Merge branch 'main' into mattie/metrics
mattiekat May 26, 2022
50b02eb
Support default values in config
mattiekat May 26, 2022
f5e6906
Merge branch 'main' into mattie/metrics
mattiekat May 26, 2022
9fbef1e
Minor fixes
mattiekat May 27, 2022
12668b8
Use f64 conversion from primitive-types
mattiekat May 27, 2022
8512bc9
Merge branch 'main' into mattie/metrics
mattiekat May 27, 2022
87f9035
remove unused code
mattiekat May 27, 2022
5acd42c
fix const name
mattiekat May 27, 2022
3950162
improve docs
mattiekat May 27, 2022
f99697b
better var name
mattiekat May 27, 2022
e919ca8
remove unused code
mattiekat May 27, 2022
e93a41a
Merge branch 'main' into mattie/metrics
mattiekat May 27, 2022
5b506fd
remove unused code
mattiekat May 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 142 additions & 14 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ members = [
"agents/kathy",
"agents/validator",
"agents/relayer",
"ethers-prometheus"
]
1 change: 1 addition & 0 deletions rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ COPY abacus-base ./abacus-base
COPY abacus-cli ./abacus-cli
COPY abacus-core ./abacus-core
COPY abacus-test ./abacus-test
COPY ethers-prometheus ./ethers-prometheus

COPY Cargo.toml .
COPY Cargo.lock .
Expand Down
5 changes: 3 additions & 2 deletions rust/abacus-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ tracing-subscriber = { version = "0.3", features = ["json"] }
rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb" }
mockall = "0.10.2"

ethers-prometheus = { path = "../ethers-prometheus", features = ["serde"] }
abacus-core = { path = "../abacus-core" }
abacus-ethereum = { path = "../chains/abacus-ethereum"}
abacus-ethereum = { path = "../chains/abacus-ethereum" }
abacus-test = { path = "../abacus-test" }
paste = "1.0"
tracing-error = "0.2"

prometheus = "0.12"
prometheus = "0.13"

warp = "0.3"

Expand Down
5 changes: 3 additions & 2 deletions rust/abacus-base/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use futures_util::future::select_all;
use tracing::instrument::Instrumented;
use tracing::{info_span, Instrument};

use std::fmt::Debug;
use std::{collections::HashMap, sync::Arc};
use tokio::task::JoinHandle;

Expand All @@ -37,12 +38,12 @@ pub struct AbacusAgentCore {
/// The height at which to start indexing the Outbox
pub indexer: IndexSettings,
/// Settings this agent was created with
pub settings: crate::settings::Settings,
pub settings: Settings,
}

/// A trait for an abacus agent
#[async_trait]
pub trait Agent: Send + Sync + std::fmt::Debug + AsRef<AbacusAgentCore> {
pub trait Agent: Send + Sync + Debug + AsRef<AbacusAgentCore> {
/// The agent's name
const AGENT_NAME: &'static str;

Expand Down
6 changes: 3 additions & 3 deletions rust/abacus-base/src/contract_sync/metrics.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::CoreMetrics;
use prometheus::{IntGauge, IntGaugeVec};
use prometheus::{IntCounterVec, IntGauge, IntGaugeVec};
use std::sync::Arc;

/// Struct encapsulating prometheus metrics used by the ContractSync.
Expand All @@ -12,7 +12,7 @@ pub struct ContractSyncMetrics {
pub stored_events: IntGaugeVec,
/// Unique occasions when agent missed an event (label values
/// differentiate checkpoints vs. messages)
pub missed_events: IntGaugeVec,
pub missed_events: IntCounterVec,
/// An optional gauge for tracking the latest message leafs that are being indexed
pub message_leaf_index: Option<IntGauge>,
}
Expand All @@ -37,7 +37,7 @@ impl ContractSyncMetrics {
.expect("failed to register stored_events metric");

let missed_events = metrics
.new_int_gauge(
.new_int_counter(
"contract_sync_missed_events",
"Number of unique occasions when agent missed an event",
&["data_type", "contract_name", "agent"],
Expand Down
Loading