Telemetry improvements (#1886)

* Fix typo

* Support multiple telemetry endpoints and verbosity levels

* Bump substrate-telemetry version

* Telemetrify Aura consensus

* Telemetrify Grandpa

* Fix CI version conflicts

* Implement style remarks

* Fix fixture

* Implement style remarks

* Clone only when necessary

* Get rid of Arc for URL

* Handle connection issues better
This commit is contained in:
Michael Müller
2019-02-28 12:22:05 +01:00
committed by Bastian Köcher
parent 8a72abffdd
commit 90e5c5ddfb
18 changed files with 285 additions and 66 deletions
+5 -5
View File
@@ -41,7 +41,7 @@ use exit_future::Signal;
pub use tokio::runtime::TaskExecutor;
use substrate_executor::NativeExecutor;
use parity_codec::{Encode, Decode};
use tel::telemetry;
use tel::*;
pub use self::error::{ErrorKind, Error};
pub use config::{Configuration, Roles, PruningMode};
@@ -128,7 +128,7 @@ impl<Components: components::Components> Service<Components> {
let version = config.full_version();
info!("Best block: #{}", best_header.number());
telemetry!("node.start"; "height" => best_header.number().as_(), "best" => ?best_header.hash());
telemetry!(SUBSTRATE_INFO; "node.start"; "height" => best_header.number().as_(), "best" => ?best_header.hash());
let network_protocol = <Components::Factory>::build_network_protocol(&config)?;
let transaction_pool = Arc::new(
@@ -269,7 +269,7 @@ impl<Components: components::Components> Service<Components> {
)?;
// Telemetry
let telemetry = config.telemetry_url.clone().map(|url| {
let telemetry = config.telemetry_endpoints.clone().map(|endpoints| {
let is_authority = config.roles == Roles::AUTHORITY;
let network_id = network.local_peer_id().to_base58();
let pubkey = format!("{}", public_key);
@@ -278,9 +278,9 @@ impl<Components: components::Components> Service<Components> {
let version = version.clone();
let chain_name = config.chain_spec.name().to_owned();
Arc::new(tel::init_telemetry(tel::TelemetryConfig {
url: url,
endpoints,
on_connect: Box::new(move || {
telemetry!("system.connected";
telemetry!(SUBSTRATE_INFO; "system.connected";
"name" => name.clone(),
"implementation" => impl_name.clone(),
"version" => version.clone(),