
Sentry Span Streaming
Switch a Sentry JavaScript SDK setup from transaction-batched traces to span streaming for faster, per-span observability in production.
Overview
Sentry Span Streaming is an agent skill for the Operate phase that migrates Sentry JavaScript projects from transaction-batched tracing to streamed span delivery.
Install
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-span-streamingWhat is this skill?
- Migrates default static trace lifecycle to stream mode so spans ship as they complete
- Documents spanStreamingIntegration and withStreamedSpan-style setup for supported JS runtimes
- Covers Browser, Node.js, Bun, Deno, and Cloudflare SDK paths with explicit unsupported-SDK guidance
- Child skill under sentry-feature-setup with Bash/Read/Edit/Write tooling for repo changes
- Targets lower-latency trace delivery versus one end-of-transaction batch
- Supported JavaScript targets: Browser, Node.js, Bun, Deno, Cloudflare
- Python, Ruby, Go, and other SDKs listed as not yet available for span streaming
Adoption & trust: 1 installs on skills.sh; 197 GitHub stars.
What problem does it solve?
Your Sentry traces only arrive as one bundled transaction at the end, so you miss timely per-span visibility in live systems.
Who is it for?
Indie SaaS or API owners on supported JavaScript Sentry SDKs who need fresher trace data without rewriting their entire observability stack.
Skip if: Teams on Python, Ruby, Go, or other SDKs marked unsupported, or greenfield apps with no Sentry SDK yet.
When should I use this skill?
User asks to enable span streaming, migrate to span streaming, use traceLifecycle stream, add spanStreamingIntegration, or switch from transaction-based to streamed span delivery.
What do I get? / Deliverables
After migration, supported JS SDKs emit spans in streams via traceLifecycle stream and integration hooks so monitoring pipelines see work as it completes.
- Updated Sentry SDK config using stream trace lifecycle
- Verified span streaming integration on supported platform
Recommended Skills
Journey fit
Span streaming is an observability delivery change you apply while running and tuning production instrumentation, not while ideating features. Monitoring is the canonical shelf because the skill configures traceLifecycle, spanStreamingIntegration, and streamed span export behavior in Sentry.
How it compares
Use this focused migration skill instead of guessing span settings inside generic Sentry onboarding docs.
Common Questions / FAQ
Who is sentry-span-streaming for?
Solo builders and small teams shipping with Sentry on JavaScript-family SDKs who want streamed spans rather than end-of-transaction batches.
When should I use sentry-span-streaming?
During Operate monitoring work when you are tuning production traces; also when Ship launch prep includes final observability hardening before go-live.
Is sentry-span-streaming safe to install?
Review the Security Audits panel on this Prism page and inspect allowed-tools (Bash, Read, Edit, Write) before letting an agent modify SDK config in your repo.
Workflow Chain
Requires first: sentry feature setup
SKILL.md
READMESKILL.md - Sentry Span Streaming
> [All Skills](../../SKILL_TREE.md) > [Feature Setup](../sentry-feature-setup/SKILL.md) > Span Streaming # Sentry Span Streaming Migration Migrate from the default transaction-based trace lifecycle (`static`) to span streaming (`stream`), where spans are sent in multiple batches as they complete instead of being batched into one transaction at the end. ## Invoke This Skill When - User asks to "enable span streaming" or "migrate to span streaming" - User wants to switch from transaction-based to streamed span delivery - User mentions `traceLifecycle`, `spanStreamingIntegration`, or `withStreamedSpan` - User wants lower latency span delivery or per-span processing ## Supported Platforms | Platform | Status | |---|---| | JavaScript (Browser, Node.js, Bun, Deno, Cloudflare) | Supported | | Python | Not yet available | | Ruby | Not yet available | | Go | Not yet available | | Other SDKs | Not yet available | If the user's project does not use a supported SDK, inform them that span streaming is currently only available for JavaScript SDKs and stop here. --- ## Phase 1: Detect Identify the user's platform, SDK version, and current tracing configuration. ### 1.1 Detect Platform and SDK ```bash # Check for JavaScript Sentry packages cat package.json 2>/dev/null | grep -E '"@sentry/' # Check for Python Sentry cat requirements.txt setup.py pyproject.toml 2>/dev/null | grep -i sentry # Check for Ruby Sentry cat Gemfile 2>/dev/null | grep sentry # Check for Go Sentry cat go.mod 2>/dev/null | grep sentry ``` If an unsupported Sentry SDK is detected, inform the user that span streaming is not yet available for their platform. ### 1.2 Detect JavaScript Environment ```bash # Detect if browser, server, or both grep -rn "from '@sentry/browser'\|from '@sentry/react'\|from '@sentry/vue'\|from '@sentry/angular'\|from '@sentry/svelte'\|from '@sentry/nextjs'\|from '@sentry/nuxt'\|from '@sentry/sveltekit'\|from '@sentry/remix'\|from '@sentry/solidstart'\|from '@sentry/astro'\|from '@sentry/react-router'" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null | head -20 grep -rn "from '@sentry/node'\|from '@sentry/bun'\|from '@sentry/deno'\|from '@sentry/cloudflare'" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null | head -20 ``` ### 1.3 Find Existing Sentry Config ```bash # Find Sentry.init calls grep -rn "Sentry\.init\|init({" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null | head -20 # Find beforeSendSpan usage grep -rn "beforeSendSpan" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null # Find beforeSendTransaction usage grep -rn "beforeSendTransaction" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null # Find ignoreSpans usage grep -rn "ignoreSpans" --include="*.ts" --include="*.js" --include="*.tsx" --include="*.jsx" --include="*.mjs" -l 2>/dev/null ``` ### 1.4 Classify Environment Based on detection results, classify each `Sentry.init` call as: | Environment | Packages | Migration Path | |---|---|---| | **Browser** | `@sentry/browser`, `@sentry/react`, `@sentry/vue`, `@sentry/angular`, `@sentry/svelte` | Add `spanStreamingIntegration()` | | **Server** | `@sentry/node`, `@sentry/bun`, `@sentry/deno`, `@sentry/cloudflare` | Add `traceLifecycle: 'stream'` | | **Framework (both)** | `@sentry/nextjs`, `@sentry/nuxt`,