Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ai-semantic-conventions/src/SemanticAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const SpanAttributes = {
LLM_REQUEST_TOP_P: "gen_ai.request.top_p",
LLM_PROMPTS: "gen_ai.prompt",
LLM_COMPLETIONS: "gen_ai.completion",
LLM_INPUT_MESSAGES: "gen_ai.input.messages",
LLM_OUTPUT_MESSAGES: "gen_ai.output.messages",
LLM_RESPONSE_MODEL: "gen_ai.response.model",
LLM_USAGE_PROMPT_TOKENS: "gen_ai.usage.prompt_tokens",
LLM_USAGE_COMPLETION_TOKENS: "gen_ai.usage.completion_tokens",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"log": {
"_recordingName": "Test OpenAI instrumentation/should set LLM_INPUT_MESSAGES and LLM_OUTPUT_MESSAGES attributes for chat completions",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.6"
},
"entries": [
{
"_id": "55d89d2026cb52c5f2e9f463f5bfc5c1",
"_order": 0,
"cache": {},
"request": {
"bodySize": 101,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
},
{
"_fromType": "array",
"name": "user-agent",
"value": "OpenAI/JS 5.12.2"
},
{
"_fromType": "array",
"name": "x-stainless-arch",
"value": "arm64"
},
{
"_fromType": "array",
"name": "x-stainless-lang",
"value": "js"
},
{
"_fromType": "array",
"name": "x-stainless-os",
"value": "MacOS"
},
{
"_fromType": "array",
"name": "x-stainless-package-version",
"value": "5.12.2"
},
{
"_fromType": "array",
"name": "x-stainless-retry-count",
"value": "0"
},
{
"_fromType": "array",
"name": "x-stainless-runtime",
"value": "node"
},
{
"_fromType": "array",
"name": "x-stainless-runtime-version",
"value": "v20.10.0"
},
{
"_fromType": "array",
"name": "content-length",
"value": "101"
},
{
"_fromType": "array",
"name": "accept-encoding",
"value": "gzip,deflate"
},
{
"name": "host",
"value": "api.openai.com"
}
],
"headersSize": 503,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"messages\":[{\"role\":\"user\",\"content\":\"Tell me a joke about OpenTelemetry\"}],\"model\":\"gpt-3.5-turbo\"}"
},
"queryString": [],
"url": "https://api.openai.com/v1/chat/completions"
},
"response": {
"bodySize": 638,
"content": {
"encoding": "base64",
"mimeType": "application/json",
"size": 638,
"text": "[\"H4sIAAAAAAAAAwAAAP//\",\"jFJNb9swDL37V3A6J0WT1kuQS7F1hx1WDBharOhaGIrE2FpkUZPookGR/z5I+bCzdcAuOvDxUXzv8bUAEEaLBQjVSFatt+Pry9u7h5sP3+jy/maOv768n5c0u3Nzf/35070YJQYtf6LiA+tMUestsiG3g1VAyZimTmZlOZlPZ5MyAy1ptIlWex5fnJVj7sKSxueTablnNmQURrGAHwUAwGt+045O44tYwPnoUGkxRlmjWBybAEQgmypCxmgiS8di1IOKHKPLa39vNqCNBm4Qvnp0t2ixRQ4b0PiMljwGqAmWgdZ4BY/u0X1EJbuIibGBNXoGDhvjamACDlJlxATAF48uYnw3/DngqosyKXedtQNAOkcsk3NZ89Me2R5VWqp9oGX8gypWxpnYVAFlJJcURSYvMrotAJ6ym92JQcIHaj1XTGvM3+1CycYc8uvB6d5pwcTS9vWLA+lkWqWRpbFxkIZQUjWoe2Yfney0oQFQDDT/vcxbs3e6jav/Z3wPKIWeUVc+oDbqVHDfFjBd97/ajh7nhUXE8GwUVmwwpBw0rmRnd3cn4iYyttXKuBqDDyYfX8qx2Ba/AQAA//8=\",\"AwDdhyBqewMAAA==\"]"
},
"cookies": [
{
"domain": ".api.openai.com",
"expires": "2025-08-14T15:15:16.000Z",
"httpOnly": true,
"name": "__cf_bm",
"path": "/",
"sameSite": "None",
"secure": true,
"value": "cx2GfhENAhZ7.BZ_THTDKDP6iUAOd_j608ETi1oaSTQ-1755182716-1.0.1.1-htqisA8ahupYucMxitr6HT.0bDvz_LUvI6LAiVJvzGVO_ybz_t9zaFBoNDlBYYwffwSfX8989wHANes2K38pR4N7nNR5h81EREnhK0td5gY"
},
{
"domain": ".api.openai.com",
"httpOnly": true,
"name": "_cfuvid",
"path": "/",
"sameSite": "None",
"secure": true,
"value": "jufw1SR0w67jCpX9lTPFPU6JC1zxAmwwpfT0Zt2ZvHM-1755182716423-0.0.1.1-604800000"
}
],
"headers": [
{
"name": "date",
"value": "Thu, 14 Aug 2025 14:45:16 GMT"
},
{
"name": "content-type",
"value": "application/json"
},
{
"name": "transfer-encoding",
"value": "chunked"
},
{
"name": "connection",
"value": "keep-alive"
},
{
"name": "access-control-expose-headers",
"value": "X-Request-ID"
},
{
"name": "openai-organization",
"value": "traceloop"
},
{
"name": "openai-processing-ms",
"value": "380"
},
{
"name": "openai-project",
"value": "proj_tzz1TbPPOXaf6j9tEkVUBIAa"
},
{
"name": "openai-version",
"value": "2020-10-01"
},
{
"name": "x-envoy-upstream-service-time",
"value": "478"
},
{
"name": "x-ratelimit-limit-requests",
"value": "10000"
},
{
"name": "x-ratelimit-limit-tokens",
"value": "50000000"
},
{
"name": "x-ratelimit-remaining-requests",
"value": "9999"
},
{
"name": "x-ratelimit-remaining-tokens",
"value": "49999989"
},
{
"name": "x-ratelimit-reset-requests",
"value": "6ms"
},
{
"name": "x-ratelimit-reset-tokens",
"value": "0s"
},
{
"name": "x-request-id",
"value": "req_39d442d322c44338bcc32d87ce959a1e"
},
{
"name": "cf-cache-status",
"value": "DYNAMIC"
},
{
"_fromType": "array",
"name": "set-cookie",
"value": "__cf_bm=cx2GfhENAhZ7.BZ_THTDKDP6iUAOd_j608ETi1oaSTQ-1755182716-1.0.1.1-htqisA8ahupYucMxitr6HT.0bDvz_LUvI6LAiVJvzGVO_ybz_t9zaFBoNDlBYYwffwSfX8989wHANes2K38pR4N7nNR5h81EREnhK0td5gY; path=/; expires=Thu, 14-Aug-25 15:15:16 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
},
{
"_fromType": "array",
"name": "set-cookie",
"value": "_cfuvid=jufw1SR0w67jCpX9lTPFPU6JC1zxAmwwpfT0Zt2ZvHM-1755182716423-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
},
{
"name": "strict-transport-security",
"value": "max-age=31536000; includeSubDomains; preload"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "server",
"value": "cloudflare"
},
{
"name": "cf-ray",
"value": "96f13c241a31c22f-TLV"
},
{
"name": "content-encoding",
"value": "gzip"
},
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=86400"
}
],
"headersSize": 1294,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-08-14T14:45:15.355Z",
"time": 953,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 953
}
}
],
"pages": [],
"version": "1.2"
}
}
Loading
Loading