About RunTree usage

Is there any detailed doc about how to use RunTree? For example, how to create a new RunTree, how to append children, how to find a RunTree by ID, how to end a RunTree. Thanks!

I couldn’t find a way to get RunTree by ID, I can only get Run through client.readRun. How to convert this run to runtree?

Hey @zhlmmc, have you checked out this section of the docs?

You can also checkout our API refs for a full list of available methods:

As for your last question, can you go into more detail around what you’re trying to do?

these docs does not help. The reason that I need to get RunTree by ID is that I’m trying to manually construct the tracing tree. And I found that when you postRun you need to set parent_run not just parent_run_id, otherwise the child run will not be appended to the parent run.

Hi @zhlmmc are you trying to manually construct the tracing tree to perform distributed tracing? If so, you would need the whole tracing context, only the ID will not be enough since the RunTree is stored in-memory. Let us know your use case!

Let me try to put it simple, the agent job may take a lot of task and steps. Steps belongs to tasks. We have the runId of each task and step in database. Sometimes, the job get interrupted and resumed. The runTree object in memory is gone, we have to construct the runTree based on the runIDs saved in database. Now, the problem is we can’t find a way to construct a runTree from the saved id. @Marco I’m in SF, in case you are in town I can come by and explain that in person. It’s blocking us currently.

@Marco just to let you know that toHears and fromHeaders works.