mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 21:27:57 +00:00
Better RPC prometheus metrics. (#9358)
* Better RPC prometehus metrics. * Add session metrics. * Add counting requests as well. * Fix type for web build. * Fix browser-node * Filter out unknown method names. * Change Gauge to Counters * Use micros instead of millis. * cargo fmt * Update client/rpc-servers/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * move log to separate lines. * Fix compilation. * cargo +nightly fmt --all Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -639,12 +639,15 @@ where
|
||||
)
|
||||
};
|
||||
let rpc_metrics = sc_rpc_server::RpcMetrics::new(config.prometheus_registry())?;
|
||||
let rpc = start_rpc_servers(&config, gen_handler, rpc_metrics.clone())?;
|
||||
let server_metrics = sc_rpc_server::ServerMetrics::new(config.prometheus_registry())?;
|
||||
let rpc = start_rpc_servers(&config, gen_handler, rpc_metrics.clone(), server_metrics)?;
|
||||
// This is used internally, so don't restrict access to unsafe RPC
|
||||
let known_rpc_method_names =
|
||||
sc_rpc_server::method_names(|m| gen_handler(sc_rpc::DenyUnsafe::No, m))?;
|
||||
let rpc_handlers = RpcHandlers(Arc::new(
|
||||
gen_handler(
|
||||
sc_rpc::DenyUnsafe::No,
|
||||
sc_rpc_server::RpcMiddleware::new(rpc_metrics, "inbrowser"),
|
||||
sc_rpc_server::RpcMiddleware::new(rpc_metrics, known_rpc_method_names, "inbrowser"),
|
||||
)?
|
||||
.into(),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user