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
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"
}'