DashboardsentrySession 0ZbAGnn6DcpV

Session 0ZbAGnn6DcpV

Full ID: 0ZbAGnn6DcpVKlaLX
Messages: 10
Distillations: 0
Time range: 2026-05-09 11:41:42 — 2026-05-09 11:42:48

Conversation (10 messages)

Research Sentry's AI/LLM monitoring capabilities. Fetch these URLs and summarize what's available:

  1. https://docs.sentry.io/platforms/javascript/guides/bun/tracing/instrumentation/ai-monitoring/ - or the closest path that exists
  2. https://docs.sentry.io/product/insights/ai-insights/
  3. https://docs.sentry.io/platforms/javascript/tracing/instrumentation/custom-instrumentation/

I need to understand:

  • What SDK methods are available for AI/LLM monitoring (e.g., ai pipe spans, token usage tracking)
  • How to create AI pipeline spans with input/output token counts
  • How to record model names, prompt tokens, completion tokens
  • Whether @sentry/bun supports this or if it needs @sentry/node features
  • Any specific span operations like "ai.pipeline", "ai.completion", etc.

Also fetch: https://github.com/getsentry/sentry-javascript/tree/develop/packages/core/src/integrations to see if there's an AI integration module.

gateway · 2026-05-09 11:41:42

I'll fetch all four URLs in parallel to gather the information you need.

claude-opus-4-6 · 2026-05-09 11:41:42 · ~25 tokens

[tool results provided]

gateway · 2026-05-09 11:41:49

Let me fetch some additional pages to fill in the gaps — the AI-specific docs and the well-known span operations list.

claude-opus-4-6 · 2026-05-09 11:41:49 · ~40 tokens

[tool results provided]

gateway · 2026-05-09 11:42:00

Good, I found the AI monitoring docs path. Let me now fetch the actual AI agent monitoring getting-started guide and the semantic attributes source to get the exact attribute names.

claude-opus-4-6 · 2026-05-09 11:42:00 · ~61 tokens

[tool results provided]

gateway · 2026-05-09 11:42:07

Now let me get the Node.js-specific AI agent monitoring guide and the raw semantic attributes file to see all the gen_ai constants.

claude-opus-4-6 · 2026-05-09 11:42:07 · ~45 tokens

[tool results provided]

gateway · 2026-05-09 11:42:48

Here's a comprehensive summary of Sentry's AI/LLM monitoring capabilities for the JavaScript SDK.


Sentry AI/LLM Monitoring — Summary

1. Overview

Sentry has a full AI Agent Monitoring system built on top of its tracing infrastructure. It uses OpenTelemetry-aligned semantic conventions with the gen_ai.* attribute namespace. There is no special AI integration module in @sentry/core/src/integrations/ — instead, AI monitoring is done via:

  • Automatic integrations for specific AI libraries (each is a separate integration)
  • Manual instrumentation using standard Sentry.startSpan() with well-known gen_ai.* span ops and attributes

2. Span Operations (the op field)

The ai category is a recognized span operation category. The specific well-known ops are:

| Span op | gen_ai.operation.name | Purpose | |---|---|---| | gen_ai.chat | "chat" | LLM chat completion request | | gen_ai.invoke_agent | "invoke_agent" | Full agent execution lifecycle | | gen_ai.execute_tool | "execute_tool" | Tool/function call execution | | gen_ai.handoff | "handoff" | Agent-to-agent transition |

Other well-defined gen_ai.operation.name values: "embeddings", "generate_content", "text_completion", "create_agent".

3. Span Hierarchy

── invoke_agent My Agent          (gen_ai.invoke_agent)
   ├── chat gpt-4o                (gen_ai.chat)          ← 1st LLM call
   ├── execute_tool get_weather   (gen_ai.execute_tool)   ← tool run
   ├── chat gpt-4o                (gen_ai.chat)          ← 2nd LLM call
   └── ...

4. Key Attributes for AI/LLM Spans

Common (all AI spans):

| Attribute | Type | Required? | |---|---|---| | gen_ai.operation.name | string | required | | gen_ai.provider.name | string | optional |

Chat/LLM request span (gen_ai.chat):

| Attribute | Type | Description | |---|---|---| | gen_ai.request.model | string | Requested model name (e.g. "o3-mini") | | ...

claude-opus-4-6 · 2026-05-09 11:42:48 · ~2.4K tokens