Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Valid examples:
```
gen_ai.invoke_agent
├── gen_ai.chat
├── gen_ai.memory
├── gen_ai.memory.client
├── gen_ai.extract
├── gen_ai.chat
├── gen_ai.execute_tool
Expand All @@ -55,7 +55,7 @@ gen_ai.invoke_agent
├── gen_ai.execute_tool
└── gen_ai.chat
gen_ai.decide
gen_ai.memory
gen_ai.memory.client
```

### Subagent
Expand Down
44 changes: 27 additions & 17 deletions develop-docs/sdk/telemetry/traces/span-data-conventions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@ Below describes the conventions for the Span interface for the `data` field on t

## AI

| Attribute | Type | Description | Examples |
|-----------------------------|---------|-------------------------------------------------------|------------------------------------------|
| `ai.input_messages` | string | The input messages sent to the model | `[{"role": "user", "message": "hello"}]` |
| `ai.completion_tоkens.used` | int | The number of tokens used to respond to the message | `10` |
| `ai.prompt_tоkens.used` | int | The number of tokens used to process just the prompt | `20` |
| `ai.total_tоkens.used` | int | The total number of tokens used to process the prompt | `30` |
| `ai.model_id` | list | The vendor-specific ID of the model used | `"gpt-4"` |
| `ai.streaming` | boolean | Whether the request was streamed back | `true` |
| `ai.responses` | list | The response messages sent back by the AI model | `["hello", "world"]` |

These attributes follow [Sentry Conventions](https://github.com/getsentry/sentry-conventions/), the source of truth for `gen_ai.*` attributes. For span ops and the full set of attributes per span type, see the <Link to="/sdk/telemetry/traces/modules/ai-agents/">AI Agents Module</Link>.

<ConventionAttributes
attributes={[
'gen_ai.input.messages',
'gen_ai.output.messages',
'gen_ai.request.model',
'gen_ai.response.streaming',
'gen_ai.usage.input_tokens',
'gen_ai.usage.output_tokens',
'gen_ai.usage.total_tokens',
]}
/>

## Thread

Expand All @@ -120,10 +123,17 @@ Below describes the conventions for the Span interface for the `data` field on t

Names that SDKs are still sending so we cannot remove them yet, but should not be used in new code.

| Attribute | New name |
| ------------------- | ----------------------------------- |
| `method` | `http.request.method` |
| `http.method` | `http.request.method` |
| `Encoded Body Size` | `http.response_content_length` |
| `Decoded Body Size` | `http.decoded_response_body_length` |
| `Transfer Size` | `http.response_transfer_size ` |
| Attribute | New name |
| --------------------------- | ----------------------------------- |
| `method` | `http.request.method` |
| `http.method` | `http.request.method` |
| `Encoded Body Size` | `http.response_content_length` |
| `Decoded Body Size` | `http.decoded_response_body_length` |
| `Transfer Size` | `http.response_transfer_size ` |
| `ai.input_messages` | `gen_ai.input.messages` |
| `ai.responses` | `gen_ai.output.messages` |
| `ai.model_id` | `gen_ai.request.model` |
| `ai.streaming` | `gen_ai.response.streaming` |
| `ai.prompt_tokens.used` | `gen_ai.usage.input_tokens` |
| `ai.completion_tokens.used` | `gen_ai.usage.output_tokens` |
| `ai.total_tokens.used` | `gen_ai.usage.total_tokens` |
Loading