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
@@ -11,7 +11,6 @@ pub use sc_executor::NativeExecutor;
use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
use sc_finality_grandpa::SharedVoterState;
use sc_keystore::LocalKeystore;
use sc_telemetry::TelemetrySpan;
// Our native executor instance.
native_executor_instance!(
@@ -37,7 +36,6 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
AuraPair
>,
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
Option<TelemetrySpan>,
)
>, ServiceError> {
if config.keystore_remote.is_some() {
@@ -46,7 +44,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
}
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
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);
@@ -87,7 +85,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
select_chain,
transaction_pool,
inherent_data_providers,
other: (aura_block_import, grandpa_link, telemetry_span),
other: (aura_block_import, grandpa_link),
})
}
@@ -109,7 +107,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
select_chain,
transaction_pool,
inherent_data_providers,
other: (block_import, grandpa_link, telemetry_span),
other: (block_import, grandpa_link),
} = new_partial(&config)?;
if let Some(url) = &config.keystore_remote {
@@ -177,7 +175,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
network_status_sinks,
system_rpc_tx,
config,
telemetry_span,
},
)?;
@@ -260,7 +257,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
/// Builds a new service for a light client.
pub fn new_light(mut config: Configuration) -> Result<TaskManager, 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(sc_finality_grandpa::grandpa_peers_set_config());
@@ -327,7 +324,6 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
network,
network_status_sinks,
system_rpc_tx,
telemetry_span,
})?;
network_starter.start_network();