Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
277 commits
Select commit Hold shift + click to select a range
59429ab
WIP
cecton Oct 29, 2020
c7e824a
Serialize instead of stringify
cecton Oct 29, 2020
28a79a0
WIP
cecton Oct 30, 2020
6ac4ea8
WIP
cecton Oct 30, 2020
6d6da6d
CLEANUP
cecton Oct 30, 2020
e1bd592
CLEANUP
cecton Oct 30, 2020
389da31
CLEANUP
cecton Oct 30, 2020
4602bcf
Re-using telemetry nodes
cecton Oct 30, 2020
aadae1c
Refactoring guarding object
cecton Oct 30, 2020
520c38b
Inject span id in the json (not elegant)
cecton Oct 30, 2020
fe28d76
Merge commit 3664cdbc92b13d7197fbf2a7fa2b0cd6201eba09 (no conflict)
cecton Oct 30, 2020
ab089f9
Merge commit cab986549f964a081343336797bb6cf6b3526335 (conflicts)
cecton Oct 30, 2020
7385c62
Fix passing transport argument
cecton Oct 30, 2020
cc41d72
CLEANUP
cecton Nov 4, 2020
a5c64fd
Spawn 2 nodes instead of one
cecton Nov 4, 2020
79f05ac
WIP
cecton Nov 4, 2020
24f3c0d
WIP
cecton Nov 5, 2020
1476571
WIP
cecton Nov 5, 2020
295a18e
Use proper FormatEvent in the browser
cecton Nov 6, 2020
2f40937
Smol fix
cecton Nov 6, 2020
b17aa9d
CLEANUP
cecton Nov 6, 2020
a8c6e8c
Removed Arc<Mutex<...>> in Telemetries
cecton Nov 12, 2020
1b83b6f
CLEANUP
cecton Nov 12, 2020
66a2db9
browser: share transport instance
cecton Nov 12, 2020
0320c95
Telemetries still need to be clonable to pass it to other nodes
cecton Nov 12, 2020
76f12bb
Move logging.rs to its own crate sc-logging
cecton Nov 12, 2020
12b7d52
Split module to pieces RIP
cecton Nov 12, 2020
e49e181
rustfmt
cecton Nov 12, 2020
6416651
Fix tests
cecton Nov 12, 2020
00f34bd
Revert "Spawn 2 nodes instead of one"
cecton Nov 12, 2020
84c3fac
Merge commit 095d0f06a42b66a92f28d097499a69e3f170d59d (no conflict)
cecton Nov 12, 2020
6960f4f
Doc
cecton Nov 12, 2020
0708147
Replace Vec by Iterator
cecton Nov 12, 2020
4b6091c
Doc
cecton Nov 12, 2020
fa4265e
Revert "Replace Vec by Iterator"
cecton Nov 12, 2020
33268f1
Solving weird bug
cecton Nov 13, 2020
4522330
Clever trick taken from jsonrpc-core to circumvent the deserializing …
cecton Nov 13, 2020
dc5cfb0
Same trick to fix serialization issue in tests
cecton Nov 13, 2020
326feb5
Fixing again
cecton Nov 13, 2020
d095426
Merge commit e26a46a805d68ce55457d67552ba71b76421f708 (no conflict)
cecton Nov 18, 2020
2ecb656
Merge commit 02771e146f126a9759a62948ec8a2edd6ad47ee9 (conflicts)
cecton Nov 18, 2020
bda2398
Merge commit 99602cda4e1c06d66a40aa933789308d4ca9a7ce (no conflict)
cecton Nov 18, 2020
15a1b9b
Merge commit 08b217a0650635f8430655979c581f0cebe4bed3 (conflicts)
cecton Nov 18, 2020
fe918f5
Merge commit 407cd3af06b03201a506b645c9ee587e5d4748bb (no conflict)
cecton Nov 18, 2020
deb7c42
Cargo.lock
cecton Nov 18, 2020
6fc89f9
doc
cecton Nov 18, 2020
2f9fcb0
Move sc-cli-proc-macro to sc-logging-proc-macro
cecton Nov 18, 2020
bed3d31
Make prefix_logs_with accessible also from sc-cli
cecton Nov 18, 2020
64a7627
Doc
cecton Nov 18, 2020
b5420e6
doc
cecton Nov 18, 2020
388bafd
README.md
cecton Nov 18, 2020
a177df4
Removed some not working logs (not too important either)
cecton Nov 18, 2020
53f91ba
Use tracing Id instead of u64
cecton Nov 18, 2020
ad70639
Doc
cecton Nov 18, 2020
c83849d
Doc and rename init function
cecton Nov 18, 2020
af78842
Clean-up & better error code
cecton Nov 18, 2020
b110d38
CLEANUP
cecton Nov 18, 2020
f26db51
Renamed invalid name for creating Telemetry
cecton Nov 18, 2020
d791b48
Move stuff around
cecton Nov 19, 2020
0fbf1a9
Comment
cecton Nov 19, 2020
647b4a4
Doc
cecton Nov 19, 2020
448c8a1
Unneeded clone
cecton Nov 19, 2020
aa5fdbe
Renamed message_verbosity to verbosity
cecton Nov 19, 2020
db42f20
Change match to if let
cecton Nov 19, 2020
98c791f
Unneeded clone
cecton Nov 19, 2020
537d882
Fix doc
cecton Nov 19, 2020
5ec5792
Apply suggestions from code review
cecton Nov 19, 2020
a0907d5
Merge commit c180950de63dbdfaa11053a8a56f35e694ed9e36 (no conflict)
cecton Nov 19, 2020
5f68c2b
Merge remote-tracking branch 'origin/master' into cecton-telemetry-wi…
cecton Nov 19, 2020
2ce02f8
Unused variable in test
cecton Nov 19, 2020
8e1a83e
Renamed init_logger to init_logging_and_telemetry
cecton Nov 19, 2020
75672d9
English fixes
cecton Nov 19, 2020
1fe185b
Improve error message
cecton Nov 19, 2020
efbbf9e
Removed unused_crate_dependencies
cecton Nov 25, 2020
de15a04
Move sc-logging to a tracing module
cecton Nov 25, 2020
e1650bf
Apply suggestion
cecton Nov 25, 2020
96730ca
Apply suggestions
cecton Nov 25, 2020
86929c3
Apply suggestion
cecton Nov 25, 2020
e10fbc2
Apply suggestion
cecton Nov 25, 2020
162bf74
Apply suggestion
cecton Nov 25, 2020
7b1b5ac
More explanation
cecton Nov 25, 2020
5afe364
Fix doc comment
cecton Nov 25, 2020
f3c2786
Fixes
cecton Nov 25, 2020
ca23c7a
Fix test
cecton Nov 25, 2020
717e2cd
Missing dependency
cecton Nov 25, 2020
39306ca
Fix wrong path
cecton Nov 25, 2020
f87ed55
Write to stderr without panicking
cecton Nov 25, 2020
00b7015
Merge commit 1c122c6d138f7f58f1ed7ce1414cf3dd283cd4ce (no conflict)
cecton Nov 25, 2020
e8e0d23
Merge commit a0e8b7ecd1d1d44bfdad1e67ef4028121f7d9d82 (conflicts)
cecton Nov 25, 2020
de0e378
Merge commit 0840c58849bc84e7fd72627745bda243741adcd8 (no conflict)
cecton Nov 25, 2020
5bf08e2
Merge commit d021078200021b1fcae1aa8434282edd9e6a8f4b (conflicts)
cecton Nov 25, 2020
70f016f
Merge commit 7e94f01af67c498605eb0206b7fca261f12a278c (no conflict)
cecton Nov 25, 2020
d9f4ef6
Merge commit 31733d5075bdba62df00975df0463a56fadbcaa1 (conflicts)
cecton Nov 25, 2020
efd8a3b
Merge commit 1ec8a7f57ba5faac74c09296eab9977fb331c386 (no conflict)
cecton Nov 25, 2020
02d196e
Fix another issue with arbitrary_precision
cecton Nov 26, 2020
21c8e05
Fixed test to use sc_cli
cecton Nov 26, 2020
22f72fa
Update README.md
cecton Nov 26, 2020
f44dd19
Remove arbitrary_precision
cecton Nov 26, 2020
d208832
Do not panic if serialization fail during runtime
cecton Nov 26, 2020
b99af5c
Fix for lack of arbitrary_precision in serde_json
cecton Nov 26, 2020
5a0e055
Fix incorrect doc
cecton Nov 27, 2020
2bc432e
Rework doc
cecton Nov 27, 2020
b47aaf9
Spelling and small change
cecton Nov 27, 2020
887a526
Improve doc again
cecton Nov 27, 2020
b11d95e
Drop unused "level" in payload
cecton Nov 27, 2020
e5c74e5
WIP Refactor to single worker
cecton Dec 2, 2020
f36606d
WIP
cecton Dec 2, 2020
fc96779
WIP
cecton Dec 2, 2020
89d6bd2
WIP
cecton Dec 2, 2020
ee63974
WIP
cecton Dec 2, 2020
df1778d
WIP
cecton Dec 2, 2020
b67ff7d
WIP
cecton Dec 2, 2020
3f6f8eb
WIP
cecton Dec 2, 2020
20e0f42
WIP
cecton Dec 3, 2020
5cf613f
Using Arc<Mutex<>>
cecton Dec 3, 2020
8addedd
Revert "Using Arc<Mutex<>>"
cecton Dec 3, 2020
1b4762a
WIP
cecton Dec 3, 2020
bec2d67
WIP
cecton Dec 3, 2020
2b49cab
CLEANUP
cecton Dec 3, 2020
64b5a6e
Apply suggestions from code review
cecton Dec 3, 2020
d2a8d42
Merge commit de44c00109ea19de13ef9219f8888f968d484b55 (no conflict)
cecton Dec 3, 2020
486012a
Merge commit d428fc79a52fce1255442ed84ec42415aea487bf (conflicts)
cecton Dec 3, 2020
cec8774
Merge commit 72cfd777812d1c374265d17524bec63ee5f07d69 (no conflict)
cecton Dec 3, 2020
9102901
Merge commit 9450a9d29156a80f48947fdf650396f488ca1c32 (conflicts)
cecton Dec 3, 2020
0f8cff5
Merge commit ace7f47735a6cb87580513d4eaa6bc7c7c398bd4 (no conflict)
cecton Dec 3, 2020
a3a72de
Merge commit b63b8643e00214f1cbe28b6ca4e804af656c9038 (conflicts)
cecton Dec 3, 2020
b699ea0
Merge commit 77f1089942b7f1190652887abb1246ea09dff894 (no conflict)
cecton Dec 3, 2020
afd7b36
Merge commit f4d4244ed6f09675f09c6e1afa96c2b595a689bf (conflicts)
cecton Dec 3, 2020
8748b46
Merge commit 675cbe9ac507a4f75bd0105ce02b00b772140c6b (no conflict)
cecton Dec 3, 2020
8e8bc3a
Merge commit 0dfdc328fa2b9514847b354e6968553a9e29d61e (conflicts)
cecton Dec 3, 2020
ca3da6d
WIP
cecton Dec 4, 2020
0817b94
Merge commit f73ac5eb0df68b72d42d25faf4da411f2d3581b6 (no conflict)
cecton Dec 4, 2020
0a8d616
WIP
cecton Dec 4, 2020
68be858
Debug
cecton Dec 4, 2020
07d8ae5
WIP
cecton Dec 9, 2020
42e0d9a
WIP
cecton Dec 10, 2020
5fe0fe2
WIP
cecton Dec 11, 2020
2ec34b0
CLEANUP
cecton Dec 11, 2020
7f19841
CLEANUP
cecton Dec 11, 2020
f433698
CLEANUP
cecton Dec 11, 2020
8dc614b
CLEANUP
cecton Dec 11, 2020
ddb71ef
WIP
cecton Dec 11, 2020
49e9434
WIP
cecton Dec 11, 2020
ba4274f
CLEANUP
cecton Dec 11, 2020
b49a0f4
CLEANUP
cecton Dec 11, 2020
eb9aed3
Revert "Make prefix_logs_with accessible also from sc-cli"
cecton Dec 16, 2020
6cf9af2
Add check for first character in json attribute
cecton Dec 16, 2020
ef26df6
WIP
cecton Dec 16, 2020
32b0b14
Remove passing around of WASM transport
cecton Dec 16, 2020
3c12ba7
Fix previous commit
cecton Dec 16, 2020
834eac4
Remove passing around of WASM transport (sc-network)
cecton Dec 16, 2020
a63bb25
Removed useless proof
cecton Dec 16, 2020
2c24ccb
Revert "Remove passing around of WASM transport (sc-network)"
cecton Dec 16, 2020
bd687ef
Revert "Fix previous commit"
cecton Dec 16, 2020
f7e88fa
Revert "Remove passing around of WASM transport"
cecton Dec 16, 2020
5140912
Re-create transport instead of passing it around
cecton Dec 16, 2020
0c41445
WIP
cecton Dec 16, 2020
0551a6b
Merge commit 4b8c862ae3b0d34ecdc351888469f81704df68e2 (no conflict)
cecton Dec 16, 2020
f0b69ed
Merge commit 9599f39a15007eba3bcc38d0eddb8af08de2b2b9 (conflicts)
cecton Dec 16, 2020
33156f8
Merge commit be8fd0588013a3b8eab5d5c761fe1c55bdd60dbb (no conflict)
cecton Dec 16, 2020
9ed09d2
Merge commit 661bbc9a73107d144aaea80e4ed0e4b54a5b2a96 (conflicts)
cecton Dec 16, 2020
9eb8b53
Merge commit b1ef77071f9b085777b4cef08a2348b762131003 (no conflict)
cecton Dec 16, 2020
48b2c77
Merge commit 2a7a985d34fea5db68f12e9c1fbde8142de27cdc (conflicts)
cecton Dec 16, 2020
2f54638
Merge commit 987a9723920217917f2708388d150add5ef52ef7 (no conflict)
cecton Dec 16, 2020
12740fe
CLEANUP
cecton Dec 16, 2020
a04451d
Renamed Telemetries to TelemetryWorker
cecton Dec 16, 2020
7b3cdb3
doc
cecton Dec 17, 2020
7ef81dc
Renamed TelemetryConnectionSinks to TelemetryConnectionNotifier
cecton Dec 17, 2020
dfa0dab
Refactor initialization and doc
cecton Dec 17, 2020
e044c0e
Re-organize
cecton Dec 17, 2020
af28034
doc
cecton Dec 17, 2020
281cacb
Fix, clean-up & re-organize
cecton Dec 17, 2020
566d95a
Use a builder pattern for global logger and remove tracing dependencies
cecton Dec 17, 2020
bb926c0
Rename to GlobalLoggerBuilder
cecton Dec 17, 2020
fe160aa
Refactor a bit
cecton Dec 17, 2020
f2667be
Handle errors better
cecton Dec 17, 2020
4e1de2a
CLEANUP
cecton Dec 17, 2020
074fa7e
CLEANUP
cecton Dec 17, 2020
70e1ac5
CLEANUP
cecton Dec 17, 2020
6130ee3
Refactor to remove Arc Mutex
cecton Dec 17, 2020
7a3fb6e
WIP
cecton Dec 17, 2020
1c5860d
formatting
cecton Dec 17, 2020
acdf211
Fix tests
cecton Dec 17, 2020
fc39a08
Fix failing test
cecton Dec 17, 2020
9be9560
Re-export global logger builder in sc-cli
cecton Dec 17, 2020
28916cb
Fix ci issue?
cecton Dec 17, 2020
787ecba
Update doc
cecton Dec 18, 2020
d2fcfcf
Simplify code a tad bit
cecton Dec 18, 2020
8e7d3cc
Update README.md
cecton Dec 18, 2020
4d52c2e
Add comment
cecton Dec 18, 2020
d670efe
CLEANUP
cecton Dec 18, 2020
9c26aa9
Apply suggestions from code review
cecton Jan 6, 2021
f4e4749
Fix after suggestion
cecton Jan 6, 2021
9ba4bff
Group hashmaps
cecton Jan 6, 2021
a6fce44
Indent
cecton Jan 6, 2021
6521813
Moving down
cecton Jan 6, 2021
b1b5545
Simplify json object creation
cecton Jan 6, 2021
37e045e
Doc
cecton Jan 6, 2021
79a04e2
Ordering stuff
cecton Jan 6, 2021
fa5ea74
Indent
cecton Jan 6, 2021
0a8ca91
Remove TelemetryError
cecton Jan 6, 2021
8dbc29f
Merge commit f1d8be84f443b9c6198d8c788118e30ef6e2a646 (no conflict)
cecton Jan 6, 2021
e2b4ac1
Merge commit 6abbbd639d07f041255fb326491fea27ece8a490 (conflicts)
cecton Jan 6, 2021
025c2a7
Merge commit 5215cd71aed415465e4d25926d426900a0b1f29a (no conflict)
cecton Jan 6, 2021
d8902f2
Merge commit 9b08105b8c7106d723c4f470304ad9e2868569d9 (conflicts)
cecton Jan 6, 2021
4fb6dbe
Merge commit 89275433863532d797318b75bb5321af098fea7c (no conflict)
cecton Jan 6, 2021
eaed136
Merge commit 762f4b0242bb9d14fa0df5b6a1a3a64b005268e4 (no conflict)
cecton Jan 7, 2021
50a59f3
Merge commit e5e7606fa54175dfc424b7ca90d60b07a3c3f026 (conflicts)
cecton Jan 7, 2021
0db22eb
Merge commit b27503591d019b94a0eea7510578dadc5ad3196c (no conflict)
cecton Jan 7, 2021
ddb53d0
New payload format & remove ts
cecton Jan 7, 2021
966fd4c
Replace dispatcher with a simple loop
cecton Jan 7, 2021
5c733cc
Re-introduce ts field as suggested
cecton Jan 8, 2021
f6fa4a1
Separate span from TelemetryHandle so we can re-enter at will
cecton Jan 8, 2021
494c024
Fix: replace std Instant not working in WASM
cecton Jan 8, 2021
280a5b6
Revert test on browser
cecton Jan 8, 2021
d4d1135
Revert "Revert "Spawn 2 nodes instead of one""
cecton Jan 8, 2021
351e3f1
Allows getting a new telemetry handle from the runner
cecton Jan 8, 2021
47132f9
Fix test code
cecton Jan 8, 2021
8295bc1
Revert test code
cecton Jan 8, 2021
8f77aa0
Fix tests
cecton Jan 8, 2021
0bd4ce7
Fix more tests
cecton Jan 8, 2021
5eb2753
Merge commit c9d93653e567f10867273b0171f3025419795c37 (no conflict)
cecton Jan 13, 2021
2e95044
Merge commit 5f3db3359ae822a1ea610059e93976c6b3dfcdde (no conflict)
cecton Jan 13, 2021
c34c3db
Merge commit fa404167bbfe7bfd459689d25fc19b86da698367 (conflicts)
cecton Jan 13, 2021
f7750a6
Doc & warn missing doc
cecton Jan 14, 2021
7770d46
Update client/tracing/src/logging/directives.rs
cecton Jan 14, 2021
b33628b
Specialized struct for the connection message
cecton Jan 14, 2021
853eb42
Update client/telemetry/src/lib.rs
cecton Jan 14, 2021
a6fdb28
Update client/telemetry/src/lib.rs
cecton Jan 14, 2021
ab0e78d
Update client/telemetry/src/lib.rs
cecton Jan 14, 2021
007a41a
Update client/telemetry/src/lib.rs
cecton Jan 14, 2021
3679140
Removed unneeded code
cecton Jan 14, 2021
0cbf0b8
Revert "Update client/telemetry/src/lib.rs"
cecton Jan 14, 2021
f1aa1a4
CLEANUP
cecton Jan 14, 2021
a626cec
Simplify stream
cecton Jan 14, 2021
09be76a
WIP
cecton Jan 15, 2021
4501e8b
Test code
cecton Jan 15, 2021
3d35251
Doc & cleanup
cecton Jan 15, 2021
eb866c1
Revert "Test code"
cecton Jan 15, 2021
2698ee4
Merge commit f1c67253bb563708c90cec6c49ebcebef4aebb3a (no conflict)
cecton Jan 15, 2021
842c4d7
Merge commit 8ee55dde2eb62f85aa64b54a0814529ea2b8368d (conflicts)
cecton Jan 15, 2021
cd716e4
Fix line width
cecton Jan 15, 2021
36ec61b
Added missing code adaptation
cecton Jan 15, 2021
def0202
Merge commit 946c0e1749b359ba3889a169079a6296b0717b0f (no conflict)
cecton Jan 15, 2021
fbc58c4
Merge commit b64ec19641fea539d56b81466e77552157afe716 (no conflict)
cecton Jan 20, 2021
24596be
Move inner functions out of run function
cecton Jan 20, 2021
f6ec36d
Fixed incorrect return of function
cecton Jan 20, 2021
f462418
Change error to expect
cecton Jan 20, 2021
acf1ec8
Another attempt to have a higher level doc
cecton Jan 20, 2021
bc36136
More doc
cecton Jan 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 5 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 26 additions & 7 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
>, ServiceError> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();

let (client, backend, keystore_container, task_manager) =
let (client, backend, keystore_container, task_manager, telemetry) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -73,17 +73,31 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
)?;

Ok(sc_service::PartialComponents {
client, backend, task_manager, import_queue, keystore_container,
select_chain, transaction_pool,inherent_data_providers,
client,
backend,
task_manager,
import_queue,
keystore_container,
select_chain,
transaction_pool,
inherent_data_providers,
telemetry,
other: (aura_block_import, grandpa_link),
})
}

/// Builds a new service for a full client.
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
let sc_service::PartialComponents {
client, backend, mut task_manager, import_queue, keystore_container,
select_chain, transaction_pool, inherent_data_providers,
client,
backend,
mut task_manager,
import_queue,
keystore_container,
select_chain,
transaction_pool,
inherent_data_providers,
telemetry,
other: (block_import, grandpa_link),
} = new_partial(&config)?;

Expand Down Expand Up @@ -141,7 +155,11 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
rpc_extensions_builder,
on_demand: None,
remote_blockchain: None,
backend, network_status_sinks, system_rpc_tx, config,
backend,
network_status_sinks,
system_rpc_tx,
config,
telemetry: telemetry.clone(),
})?;

if role.is_authority() {
Expand Down Expand Up @@ -224,7 +242,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {

/// Builds a new service for a light client.
pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
let (client, backend, keystore_container, mut task_manager, on_demand) =
let (client, backend, keystore_container, mut task_manager, on_demand, telemetry) =
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;

let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
Expand Down Expand Up @@ -291,6 +309,7 @@ pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
network,
network_status_sinks,
system_rpc_tx,
telemetry,
})?;

network_starter.start_network();
Expand Down
30 changes: 23 additions & 7 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
),
)
>, ServiceError> {
let (client, backend, keystore_container, task_manager) =
let (client, backend, keystore_container, task_manager, telemetry) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -152,9 +152,16 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
};

Ok(sc_service::PartialComponents {
client, backend, task_manager, keystore_container,
select_chain, import_queue, transaction_pool, inherent_data_providers,
other: (rpc_extensions_builder, import_setup, rpc_setup)
client,
backend,
task_manager,
keystore_container,
select_chain,
import_queue,
transaction_pool,
inherent_data_providers,
telemetry,
other: (rpc_extensions_builder, import_setup, rpc_setup),
})
}

Expand All @@ -176,8 +183,15 @@ pub fn new_full_base(
)
) -> Result<NewFullBase, ServiceError> {
let sc_service::PartialComponents {
client, backend, mut task_manager, import_queue, keystore_container,
select_chain, transaction_pool, inherent_data_providers,
client,
backend,
mut task_manager,
import_queue,
keystore_container,
select_chain,
transaction_pool,
inherent_data_providers,
telemetry,
other: (rpc_extensions_builder, import_setup, rpc_setup),
} = new_partial(&config)?;

Expand Down Expand Up @@ -223,6 +237,7 @@ pub fn new_full_base(
telemetry_connection_sinks: telemetry_connection_sinks.clone(),
network_status_sinks: network_status_sinks.clone(),
system_rpc_tx,
telemetry: telemetry.clone(),
})?;

let (block_import, grandpa_link, babe_link) = import_setup;
Expand Down Expand Up @@ -347,7 +362,7 @@ pub fn new_light_base(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) =
let (client, backend, keystore_container, mut task_manager, on_demand, telemetry) =
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;

let select_chain = sc_consensus::LongestChain::new(backend.clone());
Expand Down Expand Up @@ -434,6 +449,7 @@ pub fn new_light_base(config: Configuration) -> Result<(
network: network.clone(),
telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(),
task_manager: &mut task_manager,
telemetry,
})?;

Ok((task_manager, rpc_handlers, client, network, transaction_pool))
Expand Down
12 changes: 6 additions & 6 deletions client/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
&self,
cli: &C,
task_executor: TaskExecutor,
telemetry_senders: sc_telemetry::Senders,
) -> Result<Configuration> {
let is_dev = self.is_dev()?;
let chain_id = self.chain_id(is_dev)?;
Expand Down Expand Up @@ -525,6 +526,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
role,
base_path: Some(base_path),
informant_output_format: Default::default(),
telemetry_senders,
})
}

Expand All @@ -545,28 +547,26 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
/// 1. Sets the panic handler
/// 2. Initializes the logger
/// 3. Raises the FD limit
fn init<C: SubstrateCli>(&self) -> Result<()> {
fn init<C: SubstrateCli>(&self) -> Result<sc_telemetry::Senders> {
let logger_pattern = self.log_filters()?;
let tracing_receiver = self.tracing_receiver()?;
let tracing_targets = self.tracing_targets()?;

sp_panic_handler::set(&C::support_url(), &C::impl_version());

if let Err(e) = init_logger(&logger_pattern, tracing_receiver, tracing_targets) {
log::warn!("💬 Problem initializing global logging framework: {:}", e)
}
let senders = init_logger(&logger_pattern, tracing_receiver, tracing_targets)?;

if let Some(new_limit) = fdlimit::raise_fd_limit() {
if new_limit < RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT {
warn!(
"Low open file descriptor limit configured for the process. \
Current value: {:?}, recommended value: {:?}.",
Current value: {:?}, recommended value: {:?}.",
new_limit, RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT,
);
}
}

Ok(())
Ok(senders)
}
}

Expand Down
17 changes: 11 additions & 6 deletions client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ pub trait SubstrateCli: Sized {
&self,
command: &T,
task_executor: TaskExecutor,
telemetry_senders: sc_telemetry::Senders,
) -> error::Result<Configuration> {
command.create_configuration(self, task_executor)
command.create_configuration(self, task_executor, telemetry_senders)
}

/// Create a runner for the command provided in argument. This will create a Configuration and
/// a tokio runtime
fn create_runner<T: CliConfiguration>(&self, command: &T) -> error::Result<Runner<Self>> {
command.init::<Self>()?;
Runner::new(self, command)
let telemetry_senders = command.init::<Self>()?;
Runner::new(self, command, telemetry_senders)
}

/// Native runtime version.
Expand All @@ -243,7 +244,7 @@ pub fn init_logger(
pattern: &str,
tracing_receiver: sc_tracing::TracingReceiver,
profiling_targets: Option<String>,
) -> std::result::Result<(), String> {
) -> std::result::Result<sc_telemetry::Senders, String> {
fn parse_directives(dirs: impl AsRef<str>) -> Vec<Directive> {
dirs.as_ref()
.split(',')
Expand Down Expand Up @@ -316,6 +317,8 @@ pub fn init_logger(
"%Y-%m-%d %H:%M:%S%.3f".to_string()
});

let telemetry_layer = sc_telemetry::TelemetryLayer::new();
let senders = telemetry_layer.senders();
let subscriber = FmtSubscriber::builder()
.with_env_filter(env_filter)
.with_writer(std::io::stderr)
Expand All @@ -326,7 +329,9 @@ pub fn init_logger(
display_level: !simple,
display_thread_name: !simple,
})
.finish().with(logging::NodeNameLayer);
.finish()
.with(logging::NodeNameLayer)
.with(telemetry_layer);

if let Some(profiling_targets) = profiling_targets {
let profiling = sc_tracing::ProfilingLayer::new(tracing_receiver, &profiling_targets);
Expand All @@ -343,7 +348,7 @@ pub fn init_logger(
))
}
}
Ok(())
Ok(senders)
}

#[cfg(test)]
Expand Down
4 changes: 4 additions & 0 deletions client/cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ where
writer: &mut dyn fmt::Write,
event: &Event,
) -> fmt::Result {
if event.metadata().target() == sc_telemetry::TELEMETRY_LOG_SPAN {
return Ok(());
}

let normalized_meta = event.normalized_metadata();
let meta = normalized_meta.as_ref().unwrap_or_else(|| event.metadata());
time::write(&self.timer, writer, self.ansi)?;
Expand Down
12 changes: 10 additions & 2 deletions client/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ pub struct Runner<C: SubstrateCli> {

impl<C: SubstrateCli> Runner<C> {
/// Create a new runtime with the command provided in argument
pub fn new<T: CliConfiguration>(cli: &C, command: &T) -> Result<Runner<C>> {
pub fn new<T: CliConfiguration>(
cli: &C,
command: &T,
telemetry_senders: sc_telemetry::Senders,
) -> Result<Runner<C>> {
let tokio_runtime = build_runtime()?;
let runtime_handle = tokio_runtime.handle().clone();

Expand All @@ -131,7 +135,11 @@ impl<C: SubstrateCli> Runner<C> {
};

Ok(Runner {
config: command.create_configuration(cli, task_executor.into())?,
config: command.create_configuration(
cli,
task_executor.into(),
telemetry_senders,
)?,
tokio_runtime,
phantom: PhantomData,
})
Expand Down
2 changes: 0 additions & 2 deletions client/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ sc-client-api = { version = "2.0.0", path = "../api" }
sc-peerset = { version = "2.0.0", path = "../peerset" }
serde = { version = "1.0.101", features = ["derive"] }
serde_json = "1.0.41"
slog = { version = "2.5.2", features = ["nested-values"] }
slog_derive = "0.2.0"
smallvec = "0.6.10"
sp-arithmetic = { version = "2.0.0", path = "../../primitives/arithmetic" }
sp-blockchain = { version = "2.0.0", path = "../../primitives/blockchain" }
Expand Down
Loading