You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ The AI Agents module is agnostic to the library used. The SDK will instrument ex
6
6
7
7
## Spans Conventions
8
8
9
-
For your AI agents data to show up in the Sentry [AI Agents Insights](https://sentry.io/orgredirect/organizations/:orgslug/insights/agents/) a couple of different spans must be created and have welldefined names and data attributes. See below.
9
+
For your AI agents data to show up in the Sentry [AI Agents Insights](https://sentry.io/orgredirect/organizations/:orgslug/insights/agents/), a couple of different spans must be created and have well-defined names and data attributes. See below.
10
10
11
-
We try to follow the [OpenTelemetry Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) for Generative AI as close as possible. Being 100% compatible is not yet possible, because OpenTelemetry as "Span Events" which Sentry does not support. The input/output to/from an AI model is stored in span events in OpenTelemetry, as this is not possible in Sentry we add this data onto span attributes as a list.
11
+
We try to follow the [OpenTelemetry Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) for Generative AI as close as possible. Being 100% compatible is not yet possible, because OpenTelemetry has "Span Events" which Sentry does not support. The input/output to/from an AI model is stored in span events in OpenTelemetry. Since this is not possible in Sentry, we add this data onto span attributes as a list.
12
12
13
13
### Invoke Agent Span
14
14
@@ -39,8 +39,8 @@ Additional attributes on the span:
39
39
|`gen_ai.usage.output_tokens`| int | optional | The number of tokens used in the AI response. |`100`|
40
40
|`gen_ai.usage.total_tokens`| int | optional | The total number of tokens used to process the prompt. (input and output) |`190`|
41
41
42
-
-**[0]:**As span attributes only allow primitive data types (like `int`, `float`, `boolean`, `string`) this needs to be a stringified version of a list of dictionaries. Do NOT set `[{"foo": "bar"}]` but rather the string `"[{\"foo\": \"bar\"}]"`.
43
-
-**[1]:** Each item in the list of messages has the format `{role:"", content:""}` where`role` can be `"user"`, `"assistant"`, or `"system"` and`content` can either be a string or a list of dictionaries.
42
+
-**[0]:**Span attributes only allow primitive data types (like `int`, `float`, `boolean`, `string`). This means you need to use a stringified version of a list of dictionaries. Do NOT set `[{"foo": "bar"}]` but rather the string `"[{\"foo\": \"bar\"}]"`.
43
+
-**[1]:** Each message item uses the format `{role:"", content:""}`. The`role` can be `"user"`, `"assistant"`, or `"system"`. The`content` can be either a string or a list of dictionaries.
44
44
45
45
### AI Client Span
46
46
@@ -69,8 +69,8 @@ Additional attributes on the span:
69
69
|`gen_ai.usage.output_tokens`| int | optional | The number of tokens used in the AI response. |`100`|
70
70
|`gen_ai.usage.total_tokens`| int | optional | The total number of tokens used to process the prompt. (input and output) |`190`|
71
71
72
-
-**[0]:**As span attributes only allow primitive data types this needs to be a stringified version of a list of dictionaries. Do NOT set `[{"foo": "bar"}]` but rather the string `"[{\"foo\": \"bar\"}]"`.
73
-
-**[1]:** Each item in the list has the format `{role:"", content:""}` where`role` can be `"user"`, `"assistant"`, or `"system"` and`content` can either be a string or a list of dictionaries.
72
+
-**[0]:**Span attributes only allow primitive data types. This means you need to use a stringified version of a list of dictionaries. Do NOT set `[{"foo": "bar"}]` but rather the string `"[{\"foo\": \"bar\"}]"`.
73
+
-**[1]:** Each message item uses the format `{role:"", content:""}`. The`role` can be `"user"`, `"assistant"`, or `"system"`. The`content` can be either a string or a list of dictionaries.
74
74
75
75
### Execute Tool Span
76
76
@@ -87,7 +87,7 @@ Additional attributes on the span:
0 commit comments