Improved metrics (#240)

Added db metrics (kvdb_bytes_read, kvdb_bytes_written, kvdb_reads, kvdb_writes)
Added --metrics-prefix=[prefix]
This commit is contained in:
adria0.eth
2021-03-03 22:44:35 +01:00
committed by GitHub
parent ba011eba15
commit 0fcb102f03
34 changed files with 440 additions and 189 deletions

View File

@@ -475,6 +475,10 @@ usage! {
"--metrics",
"Enable prometheus metrics (only full client).",
ARG arg_metrics_prefix: (String) = "", or |c: &Config| c.metrics.as_ref()?.prefix.clone(),
"--metrics-prefix=[prefix]",
"Prepend the specified prefix to the exported metrics names.",
ARG arg_metrics_port: (u16) = 3000u16, or |c: &Config| c.metrics.as_ref()?.port.clone(),
"--metrics-port=[PORT]",
"Specify the port portion of the metrics server.",
@@ -922,6 +926,7 @@ struct Ipc {
#[serde(deny_unknown_fields)]
struct Metrics {
enable: Option<bool>,
prefix: Option<String>,
port: Option<u16>,
interface: Option<String>,
}
@@ -1338,6 +1343,7 @@ mod tests {
// METRICS
flag_metrics: false,
arg_metrics_prefix: "".into(),
arg_metrics_port: 3000u16,
arg_metrics_interface: "local".into(),
@@ -1542,6 +1548,7 @@ mod tests {
}),
metrics: Some(Metrics {
enable: Some(true),
prefix: Some("oe".to_string()),
interface: Some("local".to_string()),
port: Some(4000),
}),

View File

@@ -36,7 +36,7 @@ apis = ["rpc", "eth"]
enable = true
interface = "local"
port = 4000
prefix = "oe"
[secretstore]
http_port = 8082