Description
I am currently implementing a simplified tracing API for my uses, aiming to abstract away the complexities of manual span management. The goal is to get a straightforward API that allows me to start traces, end traces, and add subtraces without directly dealing with parent-child span relationships.
Here's what I am trying to achieve:
-
Start Trace: Initiates a new trace or a root span.
-
End Trace: Closes the currently active span and automatically manages the context to revert to the parent span.
-
Add Subtrace: Creates a new sub-span under the current active span.
I've encountered a challenge with the Span class, particularly in retrieving and managing the parent span when ending a trace. The current Span implementation exposes parentSpanId, but it doesn't provide direct access to the parent Span object, which is necessary to handle the thing properly.
Questions:
-
Is there an existing implementation or pattern within the library that supports this kind of API, specifically for managing the parent span relationship internally?
-
If such functionality is not currently available, is this normal because the lib is under development ? Am i missing something important ?