sentry-span-streaming-python

Migrates Python tracing projects from legacy span lifecycle to streaming spans.

1|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/getsentry/plugin-claude --skill sentry-span-streaming-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sentry-span-streaming-python
Source: https://github.com/getsentry/plugin-claude/tree/main/skills/sentry-span-streaming-python
Command: npx skills add https://github.com/getsentry/plugin-claude --skill sentry-span-streaming-python

SYSTEM DOCUMENTATION & REQUIREMENTS

## What problem does it solve? Python projects using the legacy span lifecycle can experience higher latency due to batched transactions; this skill guides migrating to per-span streaming to improve latency and observability.

## Core Features & Use Cases

  • Detects environments and suggests the required API changes to migrate to streaming spans.
  • Provides migration steps for start_span, start_transaction, start_child, and related APIs, plus guidelines for ignore_spans, before_send_span, and sampling.
  • Offers concrete examples and a quick-start path to enable streaming in Python SDK.

Quick Start

Start by enabling trace_lifecycle streaming in your Python project and migrate existing spans to the new API using sentry_sdk.traces.start_span while maintaining proper parentage and data attributes.

Frequently Asked Questions about sentry-span-streaming-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Python traces to span streaming for lower latency?

To migrate Python traces to span streaming, you enable the trace_lifecycle streaming mode and transition existing spans to the new API using sentry_sdk.traces.start_span while maintaining proper parentage and data attributes. This enables per-span delivery to reduce latency.

What is the difference between batched transactions and streaming spans in Python tracing?

Streaming spans enable per-span delivery, replacing the legacy span lifecycle where transactions are batched. This migration improves latency and observability by sending spans individually rather than waiting to batch and send complete transactions.

How do I migrate start_span, start_transaction, and start_child to the new streaming API?

Migrating start_span, start_transaction, and start_child involves transitioning these calls to the new streaming span lifecycle API. The migration provides concrete steps to update span creation while preserving parentage and data attributes for proper trace continuity.

Can I use ignore_spans and before_send_span with Python streaming traces?

Yes, you can use ignore_spans and before_send_span with Python streaming traces. The migration includes guidelines for configuring these features alongside sampling changes to control span delivery and processing.

Does span streaming migration require changes to sampling in the Python SDK?

Span streaming migration may require sampling changes in the Python SDK. The migration process includes guidelines for updating sampling configurations alongside API changes for start_span and related tracing methods.

What are the limitations when migrating to streaming spans in Python?

When migrating to streaming spans, you must maintain proper parentage and data attributes during the transition from start_transaction and start_child. The migration requires environment detection and safe defaults to ensure tracing continuity.