Welcome to Portkey Forum

Updated 3 months ago

Traces

@Brandon Watts
Documentation is a bit confusing here. I had the same issue. Passing the traceID outside metadata will get you what you want. also you can pass span_name (Inside metadata) to change the name from llm to whatever name you want.

I'm using node SDK, so I'm not able to give you an exact code snippet. But try giving traceID outside metadata.
Attachment
image.png
V
B
6 comments
Hey you’re right! And sorry that it’s confusing. This is a depreciated method that we’ll update today. Essentially, instead of passing the trace id, span id, span name as part of metadata, just pass them as headers, and tracing will work.
For Python, it will be:
Plain Text
result = await client.with_options(
        config="[CONFIG_NAME]",
        trace_id="xx",
        span_name="yy",
        span_id="zz",
        parent_span_id="aa" ).chat.completions.create([CREATION_ARGS])
cc @Brandon Watts again, sorry for the confusing documentation here! We will update it ASAP and let you know!
@Vrushank | Portkey the syntax you provided still is not working the trace id shows but the span information is nowhere present. Passing the property "span_name" via the metadata does change the span name like @darkprince metioned but I cant get it to work for the "parent_span_id" where the opertations are nested like the docs show. I am not able to reproduce that type of structure in python by either passing the information like you showed or by metadata properties. If you could send me just a toy example in python [vanilla python no frameworks] that recreates the same structure seen in the screenshot @darkprince showed here, it would be very helpful.
Apologies, this does work. I was able to get the nested structure correctly by aligning the parent id to the parents span id. Passing as header works as well. My guids were not lining up so everything was under the root and not displaying properly but seems to all work now. Thanks for updating the docs as well!
Ok this is great! @Brandon Watts this is a new feature, and we'd appreciate any feedback you have to make it work better for you!
Add a reply
Sign up and join the conversation on Discord