-
Notifications
You must be signed in to change notification settings - Fork 3
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: Add metrics to Block Streamer #579
Conversation
dd4ba32
to
10561b9
Compare
.with(tracing_subscriber::EnvFilter::from_default_env()) | ||
.init(); | ||
|
||
let redis_url = std::env::var("REDIS_URL").expect("REDIS_URL is not set"); | ||
let server_port = std::env::var("SERVER_PORT").expect("SERVER_PORT is not set"); | ||
let grpc_port = std::env::var("GRPC_PORT").expect("GRPC_PORT is not set"); |
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.
Will also make this change in Terraform
10561b9
to
5609feb
Compare
|
||
pub fn last_processed_block_key(&self) -> String { | ||
// TODO: rename to `last_processed_block` | ||
format!("{}:last_published_block", self.get_full_name()) |
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.
"published" should mean it actually got added to the Redis Stream
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.
LGTM! Looking forward to seeing what the metrics show us!
This PR adds the following metrics to Block Streamer:
LAST_PROCESSED_BLOCK
- height of last block seen, will be used to calculate the lag from tip of networkPROCESSED_BLOCKS_COUNT
- count of blocks seen, used to calculate BPSPUBLISHED_BLOCKS_COUNT
- count of blocks published to Redis Stream, to determine whether the block stream is publishing messagesLOGS_COUNT
- count logs by level, so we can alert on number of error logs etc.I've also slightly refactored
RedisClient
to support this change.