start moving more stats from /status to /prometheus

This commit is contained in:
Bryan Stitt 2023-01-06 14:02:06 -08:00
parent bc5ffc2366
commit eb3fe0b1b5
2 changed files with 8 additions and 8 deletions

@ -870,6 +870,13 @@ impl Web3ProxyApp {
}
};
// app.pending_transactions.sync();
// app.rpc_secret_key_cache.sync();
// "pending_transactions_count": app.pending_transactions.entry_count(),
// "pending_transactions_size": app.pending_transactions.weighted_size(),
// "user_cache_count": app.rpc_secret_key_cache.entry_count(),
// "user_cache_size": app.rpc_secret_key_cache.weighted_size(),
#[derive(Serialize)]
struct CombinedMetrics<'a> {
app: &'a Web3ProxyAppMetrics,

@ -32,16 +32,9 @@ pub async fn status(
) -> impl IntoResponse {
let body = response_cache
.get_with(FrontendResponseCaches::Status, async {
app.pending_transactions.sync();
app.rpc_secret_key_cache.sync();
// TODO: what else should we include? uptime, cache hit rates, cpu load
// TODO: what else should we include? uptime, cache hit rates, cpu load, memory used
let body = json!({
"chain_id": app.config.chain_id,
"pending_transactions_count": app.pending_transactions.entry_count(),
"pending_transactions_size": app.pending_transactions.weighted_size(),
"user_cache_count": app.rpc_secret_key_cache.entry_count(),
"user_cache_size": app.rpc_secret_key_cache.weighted_size(),
"balanced_rpcs": app.balanced_rpcs,
"private_rpcs": app.private_rpcs,
});