Welcome to Portkey Forum

Updated 3 months ago

custom span name

In my agent run, I have a bunch of LLM calls and I need to provide a name for each call or particular calls so that it is easier to identify. Right now it is hard to indentify unless and click to show the details panel.

I;m attaching a screenshot. Is it possible to pass name along with custom traceID.
Attachment
image.png
W
d
r
11 comments
hey @darkprince . We will be adding support for this very soon. Will keep you posted on this
Hey @Witherwings , Thanks for the reply. Waiting for this feature and reply.
hey @darkprince Portkey now supports custom span names. You can either use x-portkey-span-name header or can pass span_name in metadata and we will automatically set the span name. By default we set it to llm
Header is given precedence over metadata key

Plain Text
curl --location 'https://api.portkey.ai/v1/chat/completions' \
--header 'x-portkey-virtual-key: <VIRTUAL_KEY>' \
--header 'x-portkey-config: {"retry": {"attempts": 3}, "cache": {"mode": "simple"}}' \
--header 'x-portkey-api-key: <PORTKEY_API_KEY>' \
--header 'x-portkey-span-name: OpenApiChatCompletions' \
--header 'x-portkey-metadata: {"span_name":"OpenApiChatCompletionsTest"}' \
--header 'Content-Type: application/json' \
--data '{
    "stream": true,
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant"
        },
        {
            "role": "user",
            "content": "What is 2+2"
        }
    ],
    "max_tokens": 20,
    "n":2,
    "model": "gpt-3.5-turbo"
}'
@darkprince - want to help you set this up.. as we also expand support for Portkey on AI agents. Open to a quick call when you're available
Hey this is awesome, let me try it out.
Happy to get in a call. We are already loving portkey and using it for tracing and analytics, would love to explore what else portkey can do for us.
Awesome this worked as i expected. Thanks for the swift response and release.
Sent you a DM
Are you guys providing any external API which we can use to pull information specific to a traceID or something similar? We are thinking of benchmarking and logs from porkey specific to traceID would be useful.
Add a reply
Sign up and join the conversation on Discord