Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

runtime: allow span based tracing #4382

Closed
drahnr opened this issue Nov 26, 2021 · 2 comments
Closed

runtime: allow span based tracing #4382

drahnr opened this issue Nov 26, 2021 · 2 comments
Assignees

Comments

@drahnr
Copy link
Contributor

drahnr commented Nov 26, 2021

On the host side we use span based tracing which are now also available in our metrics backend.

Adding this to the runtime seems reasonable.

Outline:

Define something along:

#[runtime_interface]
pub trait SpanTrace {
 fn enter(tag: &'static str) -> SpanId {}
  fn child_enter(parent: SpanId, tag: &'static str) -> SpanId{}
 fn leave(SpanId) {}
}

which could be conveniently used similarly to the node side jaeger::Spans.

@bkchr
Copy link
Member

bkchr commented Nov 26, 2021

We already have this: https://github.com/paritytech/substrate/blob/master/primitives/io/src/lib.rs#L1202

And this feature should also be turned off by default or should be turned off when we build the on chain wasm file, as we do it for logging. We can then have special nodes that run with a wasm file that has this feature enabled.

@drahnr
Copy link
Contributor Author

drahnr commented Nov 26, 2021

So I was right and this existed :) I just didn't manage to find it. CC @sandreim

@drahnr drahnr closed this as completed Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants