-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Tracing - Implement feature to record values with span creation #4242
Conversation
|
It looks like @mattrutherford signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Change `Level` in decl_module from `INFO` to `DEBUG`, because we may want to use `INFO` in spans added manually in individual pallets, in future.
|
Can we record textual tags in the same way to annotate a timeseries? |
Currently we're able to collect key = value pairs at the time of span creation (local variables may be used as field values without an assignment), and all end up as string, (but type can be anything that is Also might be of interest that I had planned to allow effectively the same thing in substrate-analytics, the difference being the tags would be added there and persisted to the DB, able to be cross referenced with the tracing output received from substrate (telemetry). |
|
To illustrate the output format for the new values: With the following span in client.rs let span = tracing::span!(
tracing::Level::INFO,
"execute_and_import_block",
?hash,
?origin,
finalized,
enact_state
);Output to log: Telemetry: {
"ts":"2019-11-29T09:18:18.235576+00:00",
"msg":"tracing.profiling",
"line":834,
"name":"execute_and_import_block",
"time":"102156634",
"level":"INFO",
"target":"substrate_client::client",
"values":{
"hash":"0x21d3df5905c81260d61a16b429d93b37b96169330c27d41836a3de6ca66fdf6e",
"origin":"Own",
"finalized":"false",
"enact_state":"true"
}
} |
marcio-diaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
CI failing. |
Allow recording values along with new spans to capture useful information such as function arguments. This may be useful in cases where execution time is dependant on input values.
Currently only the
LogandTelemetryReceivers actually use the values. It may also be possible to use with Grafana, but need to find the best way to handle this.We do not currently support recording values after span creation. If we require this then I would prefer to make a follow-up PR to implement it.