Skip to content

Commit 71c7959

Browse files
authored
feat(ai-insights): simplify & align manual instrumentation docs (#15774)
1 parent 8b75a33 commit 71c7959

File tree

9 files changed

+462
-649
lines changed

9 files changed

+462
-649
lines changed

develop-docs/sdk/telemetry/traces/modules/ai-agents.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ Additional attributes on the span:
7777

7878
This span represents a request to an AI model or service that generates a response or requests a tool call based on the input prompt.
7979

80-
- Span `op` MUST be `"gen_ai.{gen_ai.operation.name}"`. (e.g. `"gen_ai.chat"`)
80+
- Span `op` MUST be `"gen_ai.{gen_ai.operation.name}"`. (e.g. `"gen_ai.request"`)
8181
- Span `name` SHOULD be `{gen_ai.operation.name} {gen_ai.request.model}"`. (e.g. `"chat o3-mini"`)
82-
- Attribute `gen_ai.operation.name` MUST be the operation performed.[3] (e.g. `"chat"`.)
82+
- Attribute `gen_ai.operation.name` MUST be the operation performed.[3] (e.g. `"summarize"`.)
8383
- All [Common Span Attributes](#common-span-attributes) SHOULD be set (all `required` common attributes MUST be set).
8484

8585
Additional attributes on the span:
@@ -154,7 +154,7 @@ Some attributes are common to all AI Agents spans:
154154

155155
| Attribute | Type | Requirement Level | Description | Example |
156156
| :---------------------- | :----- | :---------------- | :--------------------------------------------------------------------------------------- | :-------------------- |
157-
| `gen_ai.operation.name` | string | required | The name of the operation being performed. **[2]** | `"chat"` |
157+
| `gen_ai.operation.name` | string | required | The name of the operation being performed. **[2]** | `"summarize"` |
158158
| `gen_ai.request.model` | string | required | The name of the AI model a request is being made to. | `"gpt-4o"` |
159159
| `gen_ai.response.model` | string | optional | The name of the AI model the response was created with. | `"gpt-4o-2024-08-06"` |
160160
| `gen_ai.agent.name` | string | optional | The name of the agent this span belongs to. | `"Weather Agent"` |
@@ -164,7 +164,7 @@ Some attributes are common to all AI Agents spans:
164164

165165
| Value | Description |
166166
| :------------------- | :---------------------------------------------------------------------- |
167-
| `"chat"` | Chat completion operation such as OpenAI Chat API |
167+
| `"summarize"` | Chat completion operation such as OpenAI Chat API |
168168
| `"responses"` | OpenAI Responses API |
169169
| `"create_agent"` | Create GenAI agent |
170170
| `"embeddings"` | Embeddings operation such as OpenAI Create embeddings API |
@@ -193,5 +193,7 @@ Some attributes are common to all AI Agents spans:
193193
| `"xai"` | xAI |
194194

195195
## Size Limits
196+
196197
In addition to the [general size limits](https://docs.sentry.io/concepts/data-management/size-limits/) for events, spans, and attachments, there are specific size limits for AI integrations:
197-
- Input messages in AI integrations recorded in the span attribute `gen_ai.request.messages` are limited to 20kB per span. Messages are trimmed and truncated if they exceed the limit, retaining the most recent messages.
198+
199+
- Input messages in AI integrations recorded in the span attribute `gen_ai.request.messages` are limited to 20kB per span. Messages are trimmed and truncated if they exceed the limit, retaining the most recent messages.

docs/platforms/javascript/common/configuration/integrations/langchain.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Sentry.init({
144144

145145
By default this integration adds tracing support for LangChain operations including:
146146

147-
- **Chat model invocations** (`gen_ai.chat`) - Captures spans for chat model calls
147+
- **Chat model invocations** (`gen_ai.request`) - Captures spans for chat model calls
148148
- **LLM invocations** (`gen_ai.pipeline`) - Captures spans for LLM pipeline executions
149149
- **Chain executions** (`gen_ai.invoke_agent`) - Captures spans for chain invocations
150150
- **Tool executions** (`gen_ai.execute_tool`) - Captures spans for tool calls

docs/platforms/javascript/common/tracing/instrumentation/ai-agents-module-browser.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ notSupported:
3939

4040
With <Link to="/product/insights/ai/agents/dashboard/">Sentry AI Agent Monitoring</Link>, you can monitor and debug your AI systems with full-stack context. You'll be able to track key insights like token usage, latency, tool usage, and error rates. AI Agent Monitoring data will be fully connected to your other Sentry data like logs, errors, and traces.
4141

42-
As a prerequisite to setting up AI Agent Monitoring in browser applications, you'll need to first <PlatformLink to="/tracing/">set up tracing</PlatformLink>.
42+
As a prerequisite to setting up AI Agent Monitoring in browser applications, you'll need to first <PlatformLink to="/tracing/">set up tracing</PlatformLink>.
4343

4444
<Alert level="info">
4545

@@ -108,7 +108,6 @@ Sentry.startSpan(
108108
name: `invoke_agent ${myAgent.name}`,
109109
attributes: {
110110
"gen_ai.operation.name": "invoke_agent",
111-
"gen_ai.system": myAgent.modelProvider,
112111
"gen_ai.request.model": myAgent.model,
113112
"gen_ai.agent.name": myAgent.name,
114113
},
@@ -168,7 +167,6 @@ Sentry.startSpan(
168167
name: `chat ${myAi.model}`,
169168
attributes: {
170169
"gen_ai.operation.name": "chat",
171-
"gen_ai.system": myAi.modelProvider,
172170
"gen_ai.request.model": myAi.model,
173171
},
174172
},
@@ -253,7 +251,6 @@ if (result.toolCalls && result.toolCalls.length > 0) {
253251
op: "gen_ai.execute_tool",
254252
name: `execute_tool ${tool.name}`,
255253
attributes: {
256-
"gen_ai.system": myAi.modelProvider,
257254
"gen_ai.request.model": myAi.model,
258255
"gen_ai.tool.type": "function",
259256
"gen_ai.tool.name": tool.name,
@@ -322,7 +319,6 @@ if (result.handoffTo) {
322319
op: "gen_ai.handoff",
323320
name: `handoff from ${myAgent.name} to ${otherAgent.name}`,
324321
attributes: {
325-
"gen_ai.system": myAgent.modelProvider,
326322
"gen_ai.request.model": myAgent.model,
327323
},
328324
},

0 commit comments

Comments
 (0)