Skip to content

How do I create a nested span? #1525

Closed Answered by lalitb
ramgdev asked this question in Q&A
Feb 12, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@ramgdev - You can find the example as rustdoc here -

/// let mut child = tracer.start_with_context("bar", &parent_cx);

Also, the server part of tracing-http-propagator example demonstrate two ways to create child span:

  • Within the same thread through Tracer::start_with_context()
  • Within async code through Futures::with_context()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ramgdev
Comment options

@lalitb
Comment options

Answer selected by ramgdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants