Prometheus metrics for RPC calls (#7088)

* WS and HTTP middlewares added

* Prometheus endpoint added

* Counters renamed

* Proper style for inc

* Metrics initialization re-written

* Rework to handler middleware

* Introduce transport prefix for metrics

* String shortened

* Commented code removed, new line inserted

* One more string shortened

* Wasm build fixed

* Wasm build fixed once again

* Rework to shared metrics

* Added collectors label

* Tilde removed from cargo

* Switch to owned metrics in parameters
This commit is contained in:
Anton Gavrilov
2020-09-18 15:15:19 +02:00
committed by GitHub
parent 22ea00a169
commit 2c5a82f8f1
6 changed files with 157 additions and 29 deletions
+3 -1
View File
@@ -12,14 +12,16 @@ description = "Substrate RPC servers."
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.1.6"
jsonrpc-core = "14.2.0"
pubsub = { package = "jsonrpc-pubsub", version = "14.2.0" }
log = "0.4.8"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0-rc6"}
serde = "1.0.101"
serde_json = "1.0.41"
sp-runtime = { version = "2.0.0-rc6", path = "../../primitives/runtime" }
[target.'cfg(not(target_os = "unknown"))'.dependencies]
http = { package = "jsonrpc-http-server", version = "14.2.0" }
ws = { package = "jsonrpc-ws-server", version = "14.2.0" }
ipc = { version = "14.2.0", package = "jsonrpc-ipc-server" }
ws = { package = "jsonrpc-ws-server", version = "14.2.0" }