Skip to content

Guidance needed for implementing tracing API #168

Open
@MobiliteDev

Description

@MobiliteDev

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:

  1. Is there an existing implementation or pattern within the library that supports this kind of API, specifically for managing the parent span relationship internally?

  2. If such functionality is not currently available, is this normal because the lib is under development ? Am i missing something important ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions