mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Doc fixes for sc-telemetry & API struct rename (#7934)
* Doc fixes for sc-telemetry * Fix flag to disable log reloading * Forgot to reverse the conditions * Apply suggestion * Rename pattern to directives * Rename GlobalLoggerBuilder to LoggerBuilder * Return instead of expect * Use transparent outside the enum * Update client/tracing/src/logging/directives.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -308,11 +308,7 @@ pub fn new_full_parts<TBl, TRtApi, TExecDisp>(
|
||||
{
|
||||
let keystore_container = KeystoreContainer::new(&config.keystore)?;
|
||||
|
||||
let telemetry_span = if config.telemetry_endpoints.is_some() {
|
||||
Some(TelemetrySpan::new())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let telemetry_span = config.telemetry_endpoints.as_ref().map(|_| TelemetrySpan::new());
|
||||
let task_manager = {
|
||||
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
|
||||
TaskManager::new(config.task_executor.clone(), registry, telemetry_span.clone())?
|
||||
@@ -383,11 +379,7 @@ pub fn new_light_parts<TBl, TRtApi, TExecDisp>(
|
||||
TExecDisp: NativeExecutionDispatch + 'static,
|
||||
{
|
||||
let keystore_container = KeystoreContainer::new(&config.keystore)?;
|
||||
let telemetry_span = if config.telemetry_endpoints.is_some() {
|
||||
Some(TelemetrySpan::new())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let telemetry_span = config.telemetry_endpoints.as_ref().map(|_| TelemetrySpan::new());
|
||||
let task_manager = {
|
||||
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
|
||||
TaskManager::new(config.task_executor.clone(), registry, telemetry_span.clone())?
|
||||
|
||||
@@ -213,11 +213,8 @@ impl Configuration {
|
||||
return None;
|
||||
}
|
||||
|
||||
match self.telemetry_endpoints.as_ref() {
|
||||
// Don't initialise telemetry if `telemetry_endpoints` == Some([])
|
||||
Some(endpoints) if !endpoints.is_empty() => Some(endpoints),
|
||||
_ => None,
|
||||
}
|
||||
// Don't initialise telemetry if `telemetry_endpoints` == Some([])
|
||||
self.telemetry_endpoints.as_ref().filter(|x| !x.is_empty())
|
||||
}
|
||||
|
||||
/// Returns the network protocol id from the chain spec, or the default.
|
||||
|
||||
@@ -233,7 +233,7 @@ pub struct TaskManager {
|
||||
/// terminates and gracefully shutdown. Also ends the parent `future()` if a child's essential
|
||||
/// task fails.
|
||||
children: Vec<TaskManager>,
|
||||
/// A telemetry handle used to enter the telemetry span when a task is spawned.
|
||||
/// A `TelemetrySpan` used to enter the telemetry span when a task is spawned.
|
||||
telemetry_span: Option<TelemetrySpan>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user