Fix telemetry span not entering properly & enter span in sc-cli (#7951)

* WIP

* WIP

* Test

* bug fix

* WIP

* Revert "WIP"

This reverts commit 4e51e9adfdf0dc7cf37b562b60a0e83ca1d0b00d.

* doc

* Improve comment on why all spans are preserved

* Added missing suggestion from previous PR

* Use BoxFuture

* Move TelemetrySpan creation to sc-cli, need to test...

* Test code

* Adapt user code

* Revert "Test code"

This reverts commit 333806b2fe1626efaa2691f9f44d0b4dd979bc36.

* Update client/service/src/task_manager/mod.rs

Co-authored-by: David <dvdplm@gmail.com>

* Better & simpler solution

Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Cecile Tonglet
2021-01-29 13:03:21 +01:00
committed by GitHub
parent 4268fa0996
commit bea4a6524d
9 changed files with 47 additions and 54 deletions
+5 -8
View File
@@ -34,7 +34,7 @@ use sp_runtime::traits::Block as BlockT;
use futures::prelude::*;
use sc_client_api::{ExecutorProvider, RemoteBackend};
use node_executor::Executor;
use sc_telemetry::{TelemetryConnectionNotifier, TelemetrySpan};
use sc_telemetry::TelemetryConnectionNotifier;
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
type FullBackend = sc_service::TFullBackend<Block>;
@@ -58,10 +58,9 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
sc_consensus_babe::BabeLink<Block>,
),
grandpa::SharedVoterState,
Option<TelemetrySpan>,
)
>, ServiceError> {
let (client, backend, keystore_container, task_manager, telemetry_span) =
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
let client = Arc::new(client);
@@ -159,7 +158,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
import_queue,
transaction_pool,
inherent_data_providers,
other: (rpc_extensions_builder, import_setup, rpc_setup, telemetry_span),
other: (rpc_extensions_builder, import_setup, rpc_setup),
})
}
@@ -189,7 +188,7 @@ pub fn new_full_base(
select_chain,
transaction_pool,
inherent_data_providers,
other: (rpc_extensions_builder, import_setup, rpc_setup, telemetry_span),
other: (rpc_extensions_builder, import_setup, rpc_setup),
} = new_partial(&config)?;
let shared_voter_state = rpc_setup;
@@ -240,7 +239,6 @@ pub fn new_full_base(
remote_blockchain: None,
network_status_sinks: network_status_sinks.clone(),
system_rpc_tx,
telemetry_span,
},
)?;
@@ -365,7 +363,7 @@ pub fn new_light_base(mut config: Configuration) -> Result<(
Arc<NetworkService<Block, <Block as BlockT>::Hash>>,
Arc<sc_transaction_pool::LightPool<Block, LightClient, sc_network::config::OnDemand<Block>>>
), ServiceError> {
let (client, backend, keystore_container, mut task_manager, on_demand, telemetry_span) =
let (client, backend, keystore_container, mut task_manager, on_demand) =
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
config.network.extra_sets.push(grandpa::grandpa_peers_set_config());
@@ -445,7 +443,6 @@ pub fn new_light_base(mut config: Configuration) -> Result<(
config, backend, network_status_sinks, system_rpc_tx,
network: network.clone(),
task_manager: &mut task_manager,
telemetry_span,
})?;
Ok((