[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-sentry-sentry-span-streaming-python":3,"mdc--36sk64-key":39,"related-org-sentry-sentry-span-streaming-python":5716,"related-repo-sentry-sentry-span-streaming-python":5892},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":27,"repoUrl":28,"updatedAt":29,"license":30,"forks":31,"topics":32,"repo":34,"sourceUrl":37,"mdContent":38},"sentry-span-streaming-python","migrate Python SDK to span streaming","Migrate Python SDK to Sentry span streaming (span-first trace lifecycle). Use when asked to \"enable span streaming\", \"migrate to span streaming\", \"use trace_lifecycle stream\", or switch from transaction-based to streamed span delivery in a Python project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"sentry","Sentry","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fsentry.png","getsentry",[13,17,20,23,26],{"name":14,"slug":15,"type":16},"Observability","observability","tag",{"name":18,"slug":19,"type":16},"Performance","performance",{"name":21,"slug":22,"type":16},"Migration","migration",{"name":24,"slug":25,"type":16},"Python","python",{"name":9,"slug":8,"type":16},237,"https:\u002F\u002Fgithub.com\u002Fgetsentry\u002Fsentry-for-ai","2026-07-18T05:13:14.465006","Apache-2.0",30,[33],"tag-production",{"repoUrl":28,"stars":27,"forks":31,"topics":35,"description":36},[33],"Teach your AI coding assistant how to use Sentry - setup, debugging, alerts, and more","https:\u002F\u002Fgithub.com\u002Fgetsentry\u002Fsentry-for-ai\u002Ftree\u002FHEAD\u002Fskills-legacy\u002Fsentry-span-streaming-python","---\nname: sentry-span-streaming-python\ndescription: Migrate Python SDK to Sentry span streaming (span-first trace lifecycle). Use when asked to \"enable span streaming\", \"migrate to span streaming\", \"use trace_lifecycle stream\", or switch from transaction-based to streamed span delivery in a Python project.\nlicense: Apache-2.0\ncategory: feature-setup\nparent: sentry-feature-setup\ndisable-model-invocation: true\nallowed-tools: Bash, Read, Edit, Write, Grep, Glob\n---\n\n> [All Skills](..\u002F..\u002FSKILL_TREE.md) > [Feature Setup](..\u002Fsentry-feature-setup\u002FSKILL.md) > Span Streaming (Python)\n\n# Sentry Span Streaming Migration (Python)\n\nMigrate from the default transaction-based trace lifecycle (`static`) to span streaming (`stream`), where spans are sent individually as they complete instead of being batched into a transaction at the end.\n\nThis skill covers the Python SDK. For JavaScript, see [Span Streaming (JavaScript)](..\u002Fsentry-span-streaming-js\u002FSKILL.md). For Dart\u002FFlutter, see [Span Streaming (Dart)](..\u002Fsentry-span-streaming-dart\u002FSKILL.md).\n\n## Invoke This Skill When\n\n- User asks to \"enable span streaming\" or \"migrate to span streaming\" in a Python project\n- User wants to switch from transaction-based to streamed span delivery\n- User mentions `trace_lifecycle`, `sentry_sdk.traces`, or the new `start_span` API\n- User wants lower latency span delivery or per-span processing\n\n---\n\n### Detect Environment\n\n```bash\n# Find sentry_sdk.init calls\ngrep -rn \"sentry_sdk\\.init\\|sentry_sdk\\.init(\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find existing start_span \u002F start_transaction \u002F start_child usage\ngrep -rn \"start_span\\|start_transaction\\|start_child\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find trace decorator usage\ngrep -rn \"@trace\\|from sentry_sdk import trace\\|from sentry_sdk.tracing import trace\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find continue_trace usage\ngrep -rn \"continue_trace\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find before_send_transaction usage\ngrep -rn \"before_send_transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find direct Span \u002F Transaction class imports\ngrep -rn \"from sentry_sdk.tracing import\\|from sentry_sdk import.*Span\\|from sentry_sdk import.*Transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find set_data \u002F set_tag \u002F set_context on spans\ngrep -rn \"set_data\\|set_tag\\|set_context\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find scope.span \u002F scope.transaction \u002F containing_transaction access\ngrep -rn \"scope\\.span\\|scope\\.transaction\\|containing_transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find get_trace_context usage\ngrep -rn \"get_trace_context\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n```\n\n### Parallelization\n\nAfter detecting the environment, assess how many files need changes. If the codebase has many files to migrate (e.g. dozens of files with `start_span`, `start_transaction`, `set_data`, etc.), launch subagents to handle independent migration tasks in parallel — for example, one subagent per migration category (span creation, span data, trace propagation) or per module\u002Fpackage. Each subagent should receive the relevant migration rules from this skill and operate on a distinct set of files.\n\n### Enable Span Streaming\n\n**Prerequisites:** `sentry-sdk` `>=2.66.0` with tracing enabled (`traces_sample_rate` or `traces_sampler` configured).\n\nAdd the top-level `trace_lifecycle` option in ALL occurences of `sentry_sdk.init()`:\n\n```python\nimport sentry_sdk\n\n# Before\nsentry_sdk.init(\n    dsn=\"...\",\n    traces_sample_rate=1.0,\n)\n\n# After\nsentry_sdk.init(\n    dsn=\"...\",\n    traces_sample_rate=1.0,\n    trace_lifecycle=\"stream\",\n)\n```\n\nSpan streaming requires using the new `sentry_sdk.traces.start_span` API. The legacy `sentry_sdk.start_span` and `sentry_sdk.start_transaction` APIs will not stream spans.\n\n### Migrate Span Creation\n\n#### `start_span`\n\nReplace `sentry_sdk.start_span()` with `sentry_sdk.traces.start_span()`:\n\n```python\nimport sentry_sdk\n\n# Before\nwith sentry_sdk.start_span(name=\"flow.checkout\") as span:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"flow.checkout\") as span:\n    ...\n```\n\nOr change the import:\n\n```python\n# Before\nfrom sentry_sdk import start_span\n\n# After\nfrom sentry_sdk.traces import start_span\n```\n\nThe new API accepts:\n- `name` (required)\n- `attributes` — key-value pairs (see Migrate Span Data below)\n- `parent_span` — explicit parent span; defaults to the currently active span\n- `active` — defaults to `True`; if `False`, the span won't become other spans' parent automatically\n\nThe `description` argument no longer exists — use `name` instead. The `op` argument is no longer supported — use the `sentry.op` attribute instead:\n\n```python\n# Before\nwith sentry_sdk.start_span(op=\"http.client\", description=\"GET \u002Fapi\u002Fusers\") as span:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(\n    name=\"GET \u002Fapi\u002Fusers\",\n    attributes={\"sentry.op\": \"http.client\"},\n) as span:\n    ...\n```\n\n#### `start_transaction`\n\nReplace `sentry_sdk.start_transaction()` with `sentry_sdk.traces.start_span()`:\n\n```python\nimport sentry_sdk\n\n# Before\nwith sentry_sdk.start_transaction(name=\"flow.checkout\") as transaction:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"flow.checkout\", parent_span=None) as span:\n    ...\n```\n\nSetting `parent_span=None` forces the span to become a root span, which is the equivalent of starting a transaction in the legacy API.\n\n#### `start_child`\n\n`span.start_child()` no longer exists. Start a new span while the parent is active — it becomes a child automatically:\n\n```python\nimport sentry_sdk\n\n# Before\nwith sentry_sdk.start_span(name=\"outer\") as parent:\n    with parent.start_child(op=\"db\", description=\"SELECT\") as child:\n        ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"outer\") as parent:\n    with sentry_sdk.traces.start_span(\n        name=\"SELECT\",\n        attributes={\"sentry.op\": \"db\"},\n    ):\n        ...\n```\n\nTo control parentage explicitly (e.g. make a span a sibling rather than a child), use `parent_span`:\n\n```python\nwith sentry_sdk.traces.start_span(name=\"outer\") as span:\n    with sentry_sdk.traces.start_span(name=\"child 1\"):\n        with sentry_sdk.traces.start_span(name=\"child 2\", parent_span=span):\n            # \"child 2\" is a sibling of \"child 1\", not its child\n            ...\n```\n\n#### `@trace` Decorator\n\nReplace `sentry_sdk.trace` with `sentry_sdk.traces.trace`:\n\n```python\n# Before\nfrom sentry_sdk import trace\n\n@trace\ndef checkout():\n    ...\n\n# After — just change the import\nfrom sentry_sdk.traces import trace\n\n@trace\ndef checkout():\n    ...\n```\n\nThe new decorator also accepts optional `name` (defaults to the function name), `attributes`, and `active` arguments:\n\n```python\nfrom sentry_sdk.traces import trace\n\n@trace(name=\"checkout\", attributes={\"flow.pipeline\": \"legacy\"})\ndef checkout():\n    ...\n```\n\n#### `get_current_span`\n\nReplace `sentry_sdk.get_current_span()` with `sentry_sdk.traces.get_current_span()`:\n\n```python\n# Before\nfrom sentry_sdk import get_current_span\n\nspan = get_current_span()\n\n# After\nfrom sentry_sdk.traces import get_current_span\n\nspan = get_current_span()\n```\n\n#### `scope.span` and `scope.transaction`\n\nIf the code accesses the current span or transaction through the scope object, migrate to the new APIs:\n\n```python\nimport sentry_sdk\n\n# Before\nscope = sentry_sdk.get_current_scope()\ncurrent_span = scope.span\n\n# After\ncurrent_span = sentry_sdk.traces.get_current_span()\n```\n\n```python\nimport sentry_sdk\n\n# Before\nscope = sentry_sdk.get_current_scope()\ntransaction = scope.transaction\n\n# After\nroot_span = sentry_sdk.traces.get_current_span()._segment\n```\n\n`_segment` returns the root span of the current trace (the equivalent of what used to be the transaction). It is a private API — prefer restructuring the code to avoid needing the root span where possible.\n\n#### `span.containing_transaction`\n\n`span.containing_transaction` no longer exists. Use `span._segment` to get the root span:\n\n```python\n# Before\ntransaction = span.containing_transaction\n\n# After\nroot_span = span._segment\n```\n\n#### `Span` and `Transaction` Classes\n\nIf the code imports `Span` or `Transaction` directly (e.g. for type annotations), replace both with `StreamedSpan`:\n\n```python\n# Before\nfrom sentry_sdk.tracing import Span, Transaction\n\ndef process(span: Span) -> None:\n    ...\n\n# After\nfrom sentry_sdk.traces import StreamedSpan\n\ndef process(span: StreamedSpan) -> None:\n    ...\n```\n\n#### `get_trace_context`\n\n`span.get_trace_context()` no longer exists on streaming spans. Migrate based on what you actually need from the trace context:\n\nIf the code only reads specific fields (like `trace_id`, `span_id`, or `parent_span_id`), access them directly as span properties:\n\n```python\n# Before\nctx = span.get_trace_context()\ntrace_id = ctx[\"trace_id\"]\nspan_id = ctx[\"span_id\"]\n\n# After\ntrace_id = span.trace_id\nspan_id = span.span_id\n```\n\nIf the code genuinely needs the full trace context dict (e.g. to pass it to an external system or serialize it), use the private method `span._get_trace_context()`:\n\n```python\n# Before\nctx = span.get_trace_context()\n\n# After\nctx = span._get_trace_context()\n```\n\nPrefer the direct property access where possible — `_get_trace_context()` is a private API and may change.\n\n### Migrate Span Data\n\nIn span streaming mode, spans have no contexts, data, or tags. Everything is a span attribute. Attribute keys are strings; values must be `int`, `bool`, `str`, `float`, or an array of these types. `None` is not supported.\n\n**Important:** Unlike the old `set_data` \u002F `set_tag` APIs, `set_attribute` only supports primitive types. Non-primitive values must be either stringified or broken down into multiple primitive-typed attributes:\n\n```python\n# Before — set_data accepted any type\nspan.set_data(\"request\", {\"method\": \"POST\", \"path\": \"\u002Fapi\u002Fcheckout\"})\nspan.set_data(\"response_headers\", response.headers)\n\n# After — flatten dicts into separate attributes\nspan.set_attributes({\n    \"request.method\": \"POST\",\n    \"request.path\": \"\u002Fapi\u002Fcheckout\",\n})\n\n# After — stringify objects that can't be flattened\nspan.set_attribute(\"response_headers\", str(response.headers))\n```\n\n#### Replace `set_data`\n\n```python\n# Before\nspan.set_data(\"flow.step\", \"submit_payment\")\n\n# After\nspan.set_attribute(\"flow.step\", \"submit_payment\")\n```\n\n#### Replace `set_tag`\n\n```python\n# Before\nspan.set_tag(\"http.status_code\", 201)\n\n# After\nspan.set_attribute(\"http.response.status_code\", 201)\n```\n\nWhen migrating multiple consecutive `set_data` \u002F `set_tag` calls, combine them into a single `set_attributes()` call:\n\n```python\n# Before\nspan.set_data(\"flow.step\", \"submit_payment\")\nspan.set_data(\"flow.version\", \"0.35\")\nspan.set_tag(\"http.status_code\", 201)\n\n# After\nspan.set_attributes({\n    \"flow.step\": \"submit_payment\",\n    \"flow.version\": \"0.35\",\n    \"http.response.status_code\": 201,\n})\n```\n\n#### Replace `set_context`\n\nDictionaries are not supported as attribute values. Flatten them into separate attributes:\n\n```python\n# Before\nspan.set_context(\"flow\", {\"id\": \"123456789\", \"pipeline\": \"legacy\"})\n\n# After\nspan.set_attributes({\"flow.id\": \"123456789\", \"flow.pipeline\": \"legacy\"})\n```\n\n#### Scope-Level Tags\n\nTags set on the scope with `sentry_sdk.set_tag()` are not applied to streaming spans. Use `sentry_sdk.set_attribute()` to apply data to spans:\n\n```python\nimport sentry_sdk\n\nsentry_sdk.set_tag(\"region\", \"Europe\")       # applied to errors and other tag-supporting telemetry\nsentry_sdk.set_attribute(\"region\", \"Europe\")  # applied to spans, logs, metrics\n```\n\n#### Bulk Operations\n\n```python\nwith sentry_sdk.traces.start_span(name=\"flow.checkout\") as span:\n    span.set_attribute(\"flow.version\", \"0.35\")\n    span.set_attributes({\"flow.conversion\": 1.0, \"flow.use_new_pipeline\": True})\n    span.remove_attribute(\"flow.conversion\")\n```\n\n#### Span Status\n\nStatus can only be `ok` (default) or `error`:\n\n```python\nfrom sentry_sdk.traces import start_span\n\nwith start_span(name=\"process\") as span:\n    try:\n        ...\n    except Exception:\n        span.status = \"error\"\n```\n\n### Migrate Trace Propagation\n\n`sentry_sdk.traces.continue_trace()` replaces the legacy `sentry_sdk.continue_trace()`. It is no longer a context manager — it sets the propagation context, and the next span picks it up automatically:\n\n```python\nimport sentry_sdk\n\nheaders = {\n    \"sentry-trace\": \"4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1\",\n    \"baggage\": \"sentry-trace_id=...\",\n}\n\n# Before\nwith sentry_sdk.continue_trace(headers) as transaction:\n    ...\n\n# After\nsentry_sdk.traces.continue_trace(headers)\nwith sentry_sdk.traces.start_span(name=\"handle request\"):\n    ...\n```\n\nTo start a completely new trace, use `sentry_sdk.traces.new_trace()`:\n\n```python\nimport sentry_sdk\n\nwith sentry_sdk.traces.start_span(name=\"span in trace 1\"):\n    ...\n\nsentry_sdk.traces.new_trace()\n\nwith sentry_sdk.traces.start_span(name=\"span in trace 2\"):\n    # This span is the root of a new, separate trace\n    ...\n```\n\n### Migrate Sampling\n\nIf you use `traces_sample_rate`, no changes are needed — it works the same way.\n\nIf you use a custom `traces_sampler`, the sampling context has a different structure in streaming mode:\n\n```python\ndef traces_sampler(sampling_context):\n    # sampling_context[\"span_context\"] contains:\n    #   name, trace_id, parent_span_id, parent_sampled, attributes\n    if sampling_context[\"span_context\"][\"name\"] in IGNORED_SPAN_NAMES:\n        return 0.0\n    return 1.0\n\nsentry_sdk.init(\n    traces_sampler=traces_sampler,\n    trace_lifecycle=\"stream\",\n)\n```\n\nThe sampling decision is made when `start_span()` is called. Child spans inherit the parent's sampling decision unless filtered by `ignore_spans`.\n\n#### Custom Sampling Context\n\nCustom sampling context is no longer an argument to `start_span`. Set it on the scope before starting the span:\n\n```python\nimport sentry_sdk\n\ndef traces_sampler(sampling_context):\n    if sampling_context[\"asgi_scope\"].method not in (\"GET\", \"POST\"):\n        return 0.0\n    return 1.0\n\n# Before\nwith sentry_sdk.start_span(\n    name=\"handle request\",\n    custom_sampling_context={\"asgi_scope\": asgi_scope},\n):\n    ...\n\n# After\nsentry_sdk.Scope.set_custom_sampling_context({\"asgi_scope\": asgi_scope})\nwith sentry_sdk.traces.start_span(name=\"handle request\"):\n    ...\n```\n\nCustom sampling context must be set **after** `continue_trace` (which resets propagation context) and **before** `start_span` (which is when sampling happens).\n\n### Configure `ignore_spans` (Optional)\n\n`ignore_spans` filters spans at creation time. Rules can be strings, compiled regexes, or dictionaries with `name` and\u002For `attributes` conditions:\n\n```python\nimport re\nimport sentry_sdk\n\nsentry_sdk.init(\n    trace_lifecycle=\"stream\",\n    ignore_spans=[\n        # String match against span name\n        \"\u002Fhealth\",\n\n        # Regex match against span name\n        re.compile(r\"\u002Fflow\u002F.*\"),\n\n        # Match by attributes (all must match)\n        {\n            \"attributes\": {\n                \"service.id\": \"15def9a\",\n                \"flow.pipeline\": \"legacy\",\n            }\n        },\n\n        # Match by name and attributes\n        {\n            \"name\": re.compile(r\"\u002Fflow\u002F.*\"),\n            \"attributes\": {\n                \"service.id\": re.compile(r\".*\\.facade\"),\n            },\n        },\n    ],\n)\n```\n\n`ignore_spans` only takes effect when `trace_lifecycle=\"stream\"` is enabled. If it is set without span streaming, the SDK emits a warning and the option is ignored.\n\nOnly the span name and attributes set at creation time are available for matching — attributes added later in the span's lifetime are not considered.\n\nIf an ignored span is a top-level span, its entire subtree is also ignored. If a non-top-level span is ignored, its children are not automatically ignored unless they match a rule themselves.\n\n### Migrate `before_send_transaction`\n\n`before_send_transaction` has no effect in streaming mode. Spans are sent individually as they complete, not batched into transactions.\n\n**Important:** In the legacy transaction-based model, `before_send_transaction` ran after the entire transaction finished, so it had access to all data set during the span's lifetime (e.g. HTTP status codes, response sizes, final results). In streaming mode, the replacements (`ignore_spans` and `before_send_span`) can only work with attributes set at span start time. Attributes added later during the span's lifetime (like `http.response.status_code`, response body size, or other late-set data) are **not available**.\n\n**If your `before_send_transaction` logic depends on attributes not set at span start**, that filtering logic **cannot be replicated** in streaming mode and must be removed. Consider moving such filtering to a server-side mechanism (e.g. Sentry inbound data filters or Relay rules) instead.\n\n| Use Case | Streaming Replacement |\n|---|---|\n| Drop spans by name\u002Froute | Use `ignore_spans` |\n| Drop\u002Ffilter by late-set attributes (e.g. HTTP status code) | **Cannot be replicated** — remove the logic or use server-side filtering |\n| Modify span data before send | Use `before_send_span` |\n| Filter by transaction name | Use `ignore_spans` with string\u002Fregex pattern |\n\nRemove the `before_send_transaction` option from `sentry_sdk.init()` after migrating its logic.\n\n### Configure `before_send_span` (Optional)\n\n`before_send_span` lets you modify spans before they leave the SDK, for example to sanitize sensitive values. It receives `span` and `hint` arguments and must return a span:\n\n```python\nimport sentry_sdk\n\ndef postprocess_span(span, hint):\n    attributes_to_sanitize = [\n        \"http.request.header.custom-auth\",\n        \"http.request.header.custom-user-id\",\n    ]\n    for attribute in attributes_to_sanitize:\n        if span[\"attributes\"].get(attribute):\n            span[\"attributes\"][attribute] = \"[Sanitized]\"\n    return span\n\nsentry_sdk.init(\n    trace_lifecycle=\"stream\",\n    _experiments={\n        \"before_send_span\": postprocess_span,\n    },\n)\n```\n\n`before_send_span` cannot be used to drop spans — use `ignore_spans` for that. If the callback returns anything other than a span dictionary, the return value is ignored.\n\n### Verification\n\nInstruct the user to verify:\n\n1. **Check Sentry dashboard**: Spans should appear in the Traces view shortly after they complete, without waiting for the full transaction to finish\n2. **Check logs**: Ensure no SDK warnings about unsupported span operations\n\n#### Common Issues\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Spans not streaming | Using legacy `sentry_sdk.start_span` | Switch to `sentry_sdk.traces.start_span` |\n| `AttributeError` on `start_child` | `start_child` removed in streaming mode | Use `sentry_sdk.traces.start_span` while parent is active |\n| `None` attribute value rejected | `None` not supported as attribute value | Remove the attribute or use a sentinel string |\n| `set_data`\u002F`set_tag` has no effect on span | These methods don't apply to streaming spans | Use `span.set_attribute()` |\n| Scope tags missing from spans | `set_tag` not applied to streaming spans | Use `sentry_sdk.set_attribute()` |\n| Custom sampling context not available in `traces_sampler` | Set after `start_span` or before `continue_trace` | Set on scope after `continue_trace` but before `start_span` |\n| `scope.span` returns wrong type or `None` | Scope-based span access not reliable in streaming mode | Use `sentry_sdk.traces.get_current_span()` |\n| `AttributeError` on `containing_transaction` | Attribute removed in streaming mode | Use `span._segment` |\n| `AttributeError` on `get_trace_context` | Method removed in streaming mode | Use `span.trace_id` \u002F `span.span_id` directly, or `span._get_trace_context()` |\n| `before_send_transaction` not called | Expected in streaming mode | Migrate logic to `before_send_span` or `ignore_spans` |\n| Warning: `ignore_spans` only works with `trace_lifecycle` set to `stream` | `ignore_spans` set without span streaming enabled | Enable streaming with `trace_lifecycle=\"stream\"`, or remove `ignore_spans` |\n| `before_send_transaction` logic relied on late-set attributes (e.g. status code) | These attributes aren't available at span creation time | Remove the logic or use server-side filtering (Sentry inbound filters \u002F Relay rules) |\n\n### Quick Reference\n\n#### Minimal Setup\n\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=\"__DSN__\",\n    traces_sample_rate=1.0,\n    trace_lifecycle=\"stream\",\n)\n```\n\n#### Creating Spans\n\n```python\nfrom sentry_sdk.traces import start_span\n\nwith start_span(name=\"my operation\", attributes={\"sentry.op\": \"task\"}) as span:\n    span.set_attribute(\"result.count\", 42)\n```\n\n#### Migration Checklist\n\n- [ ] SDK version is `>=2.66.0`\n- [ ] Added top-level `trace_lifecycle=\"stream\"` to `sentry_sdk.init()`\n- [ ] `sentry_sdk.start_span()` migrated to `sentry_sdk.traces.start_span()`\n- [ ] `sentry_sdk.start_transaction()` migrated to `sentry_sdk.traces.start_span()`\n- [ ] `span.start_child()` migrated to `sentry_sdk.traces.start_span()`\n- [ ] `sentry_sdk.get_current_span()` migrated to `sentry_sdk.traces.get_current_span()`\n- [ ] `scope.span` replaced with `sentry_sdk.traces.get_current_span()`\n- [ ] `scope.transaction` replaced with `sentry_sdk.traces.get_current_span()._segment`\n- [ ] `span.containing_transaction` replaced with `span._segment`\n- [ ] `@sentry_sdk.trace` migrated to `@sentry_sdk.traces.trace`\n- [ ] `Span` \u002F `Transaction` class imports replaced with `StreamedSpan`\n- [ ] `span.get_trace_context()` replaced with direct properties (`span.trace_id`, etc.) or `span._get_trace_context()`\n- [ ] `description` replaced with `name`\n- [ ] `op` replaced with `sentry.op` attribute\n- [ ] `set_data()` \u002F `set_tag()` \u002F `set_context()` replaced with `set_attribute()`\n- [ ] Scope-level `set_tag()` supplemented with `set_attribute()` where needed\n- [ ] `continue_trace` migrated to non-context-manager `sentry_sdk.traces.continue_trace()`\n- [ ] `custom_sampling_context` migrated to `Scope.set_custom_sampling_context()`\n- [ ] (If using `traces_sampler`) Updated to handle new `sampling_context` shape\n- [ ] `before_send_transaction` logic migrated to `before_send_span` or `ignore_spans`\n- [ ] `before_send_transaction` logic that depends on late-set attributes (e.g. HTTP status code) removed or moved to server-side filtering\n- [ ] `before_send_transaction` removed from config\n- [ ] Spans visible in Sentry dashboard\n",{"data":40,"body":45},{"name":4,"description":6,"license":30,"category":41,"parent":42,"disable-model-invocation":43,"allowed-tools":44},"feature-setup","sentry-feature-setup",true,"Bash, Read, Edit, Write, Grep, Glob",{"type":46,"children":47},"root",[48,75,82,104,125,132,181,185,192,952,958,984,990,1032,1052,1166,1195,1201,1210,1230,1303,1308,1352,1357,1420,1456,1538,1546,1563,1635,1648,1657,1668,1781,1792,1839,1851,1869,1972,1998,2041,2050,2068,2141,2158,2163,2229,2294,2305,2315,2333,2377,2396,2421,2509,2517,2528,2556,2624,2636,2679,2692,2698,2740,2773,2874,2884,2928,2938,2982,3008,3096,3107,3112,3156,3162,3183,3220,3226,3264,3270,3290,3350,3356,3375,3494,3506,3587,3593,3605,3617,3708,3728,3734,3746,3885,3916,3929,3953,4184,4202,4207,4212,4223,4233,4277,4301,4401,4420,4431,4455,4600,4617,4623,4628,4652,4658,5111,5117,5123,5180,5186,5223,5229,5710],{"type":49,"tag":50,"props":51,"children":52},"element","blockquote",{},[53],{"type":49,"tag":54,"props":55,"children":56},"p",{},[57,65,67,73],{"type":49,"tag":58,"props":59,"children":61},"a",{"href":60},"..\u002F..\u002FSKILL_TREE.md",[62],{"type":63,"value":64},"text","All Skills",{"type":63,"value":66}," > ",{"type":49,"tag":58,"props":68,"children":70},{"href":69},"..\u002Fsentry-feature-setup\u002FSKILL.md",[71],{"type":63,"value":72},"Feature Setup",{"type":63,"value":74}," > Span Streaming (Python)",{"type":49,"tag":76,"props":77,"children":79},"h1",{"id":78},"sentry-span-streaming-migration-python",[80],{"type":63,"value":81},"Sentry Span Streaming Migration (Python)",{"type":49,"tag":54,"props":83,"children":84},{},[85,87,94,96,102],{"type":63,"value":86},"Migrate from the default transaction-based trace lifecycle (",{"type":49,"tag":88,"props":89,"children":91},"code",{"className":90},[],[92],{"type":63,"value":93},"static",{"type":63,"value":95},") to span streaming (",{"type":49,"tag":88,"props":97,"children":99},{"className":98},[],[100],{"type":63,"value":101},"stream",{"type":63,"value":103},"), where spans are sent individually as they complete instead of being batched into a transaction at the end.",{"type":49,"tag":54,"props":105,"children":106},{},[107,109,115,117,123],{"type":63,"value":108},"This skill covers the Python SDK. For JavaScript, see ",{"type":49,"tag":58,"props":110,"children":112},{"href":111},"..\u002Fsentry-span-streaming-js\u002FSKILL.md",[113],{"type":63,"value":114},"Span Streaming (JavaScript)",{"type":63,"value":116},". For Dart\u002FFlutter, see ",{"type":49,"tag":58,"props":118,"children":120},{"href":119},"..\u002Fsentry-span-streaming-dart\u002FSKILL.md",[121],{"type":63,"value":122},"Span Streaming (Dart)",{"type":63,"value":124},".",{"type":49,"tag":126,"props":127,"children":129},"h2",{"id":128},"invoke-this-skill-when",[130],{"type":63,"value":131},"Invoke This Skill When",{"type":49,"tag":133,"props":134,"children":135},"ul",{},[136,142,147,176],{"type":49,"tag":137,"props":138,"children":139},"li",{},[140],{"type":63,"value":141},"User asks to \"enable span streaming\" or \"migrate to span streaming\" in a Python project",{"type":49,"tag":137,"props":143,"children":144},{},[145],{"type":63,"value":146},"User wants to switch from transaction-based to streamed span delivery",{"type":49,"tag":137,"props":148,"children":149},{},[150,152,158,160,166,168,174],{"type":63,"value":151},"User mentions ",{"type":49,"tag":88,"props":153,"children":155},{"className":154},[],[156],{"type":63,"value":157},"trace_lifecycle",{"type":63,"value":159},", ",{"type":49,"tag":88,"props":161,"children":163},{"className":162},[],[164],{"type":63,"value":165},"sentry_sdk.traces",{"type":63,"value":167},", or the new ",{"type":49,"tag":88,"props":169,"children":171},{"className":170},[],[172],{"type":63,"value":173},"start_span",{"type":63,"value":175}," API",{"type":49,"tag":137,"props":177,"children":178},{},[179],{"type":63,"value":180},"User wants lower latency span delivery or per-span processing",{"type":49,"tag":182,"props":183,"children":184},"hr",{},[],{"type":49,"tag":186,"props":187,"children":189},"h3",{"id":188},"detect-environment",[190],{"type":63,"value":191},"Detect Environment",{"type":49,"tag":193,"props":194,"children":199},"pre",{"className":195,"code":196,"language":197,"meta":198,"style":198},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Find sentry_sdk.init calls\ngrep -rn \"sentry_sdk\\.init\\|sentry_sdk\\.init(\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find existing start_span \u002F start_transaction \u002F start_child usage\ngrep -rn \"start_span\\|start_transaction\\|start_child\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find trace decorator usage\ngrep -rn \"@trace\\|from sentry_sdk import trace\\|from sentry_sdk.tracing import trace\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find continue_trace usage\ngrep -rn \"continue_trace\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find before_send_transaction usage\ngrep -rn \"before_send_transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find direct Span \u002F Transaction class imports\ngrep -rn \"from sentry_sdk.tracing import\\|from sentry_sdk import.*Span\\|from sentry_sdk import.*Transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find set_data \u002F set_tag \u002F set_context on spans\ngrep -rn \"set_data\\|set_tag\\|set_context\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find scope.span \u002F scope.transaction \u002F containing_transaction access\ngrep -rn \"scope\\.span\\|scope\\.transaction\\|containing_transaction\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n\n# Find get_trace_context usage\ngrep -rn \"get_trace_context\" --include=\"*.py\" -l 2>\u002Fdev\u002Fnull | head -20\n","bash","",[200],{"type":49,"tag":88,"props":201,"children":202},{"__ignoreMap":198},[203,215,295,304,313,378,386,395,460,468,477,542,550,559,624,632,641,706,714,723,788,796,805,870,878,887],{"type":49,"tag":204,"props":205,"children":208},"span",{"class":206,"line":207},"line",1,[209],{"type":49,"tag":204,"props":210,"children":212},{"style":211},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[213],{"type":63,"value":214},"# Find sentry_sdk.init calls\n",{"type":49,"tag":204,"props":216,"children":218},{"class":206,"line":217},2,[219,225,231,237,242,247,252,256,261,265,270,275,280,285,290],{"type":49,"tag":204,"props":220,"children":222},{"style":221},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[223],{"type":63,"value":224},"grep",{"type":49,"tag":204,"props":226,"children":228},{"style":227},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[229],{"type":63,"value":230}," -rn",{"type":49,"tag":204,"props":232,"children":234},{"style":233},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[235],{"type":63,"value":236}," \"",{"type":49,"tag":204,"props":238,"children":239},{"style":227},[240],{"type":63,"value":241},"sentry_sdk\\.init\\|sentry_sdk\\.init(",{"type":49,"tag":204,"props":243,"children":244},{"style":233},[245],{"type":63,"value":246},"\"",{"type":49,"tag":204,"props":248,"children":249},{"style":227},[250],{"type":63,"value":251}," --include=",{"type":49,"tag":204,"props":253,"children":254},{"style":233},[255],{"type":63,"value":246},{"type":49,"tag":204,"props":257,"children":258},{"style":227},[259],{"type":63,"value":260},"*.py",{"type":49,"tag":204,"props":262,"children":263},{"style":233},[264],{"type":63,"value":246},{"type":49,"tag":204,"props":266,"children":267},{"style":227},[268],{"type":63,"value":269}," -l",{"type":49,"tag":204,"props":271,"children":272},{"style":233},[273],{"type":63,"value":274}," 2>",{"type":49,"tag":204,"props":276,"children":277},{"style":227},[278],{"type":63,"value":279},"\u002Fdev\u002Fnull",{"type":49,"tag":204,"props":281,"children":282},{"style":233},[283],{"type":63,"value":284}," |",{"type":49,"tag":204,"props":286,"children":287},{"style":221},[288],{"type":63,"value":289}," head",{"type":49,"tag":204,"props":291,"children":292},{"style":227},[293],{"type":63,"value":294}," -20\n",{"type":49,"tag":204,"props":296,"children":298},{"class":206,"line":297},3,[299],{"type":49,"tag":204,"props":300,"children":301},{"emptyLinePlaceholder":43},[302],{"type":63,"value":303},"\n",{"type":49,"tag":204,"props":305,"children":307},{"class":206,"line":306},4,[308],{"type":49,"tag":204,"props":309,"children":310},{"style":211},[311],{"type":63,"value":312},"# Find existing start_span \u002F start_transaction \u002F start_child usage\n",{"type":49,"tag":204,"props":314,"children":316},{"class":206,"line":315},5,[317,321,325,329,334,338,342,346,350,354,358,362,366,370,374],{"type":49,"tag":204,"props":318,"children":319},{"style":221},[320],{"type":63,"value":224},{"type":49,"tag":204,"props":322,"children":323},{"style":227},[324],{"type":63,"value":230},{"type":49,"tag":204,"props":326,"children":327},{"style":233},[328],{"type":63,"value":236},{"type":49,"tag":204,"props":330,"children":331},{"style":227},[332],{"type":63,"value":333},"start_span\\|start_transaction\\|start_child",{"type":49,"tag":204,"props":335,"children":336},{"style":233},[337],{"type":63,"value":246},{"type":49,"tag":204,"props":339,"children":340},{"style":227},[341],{"type":63,"value":251},{"type":49,"tag":204,"props":343,"children":344},{"style":233},[345],{"type":63,"value":246},{"type":49,"tag":204,"props":347,"children":348},{"style":227},[349],{"type":63,"value":260},{"type":49,"tag":204,"props":351,"children":352},{"style":233},[353],{"type":63,"value":246},{"type":49,"tag":204,"props":355,"children":356},{"style":227},[357],{"type":63,"value":269},{"type":49,"tag":204,"props":359,"children":360},{"style":233},[361],{"type":63,"value":274},{"type":49,"tag":204,"props":363,"children":364},{"style":227},[365],{"type":63,"value":279},{"type":49,"tag":204,"props":367,"children":368},{"style":233},[369],{"type":63,"value":284},{"type":49,"tag":204,"props":371,"children":372},{"style":221},[373],{"type":63,"value":289},{"type":49,"tag":204,"props":375,"children":376},{"style":227},[377],{"type":63,"value":294},{"type":49,"tag":204,"props":379,"children":381},{"class":206,"line":380},6,[382],{"type":49,"tag":204,"props":383,"children":384},{"emptyLinePlaceholder":43},[385],{"type":63,"value":303},{"type":49,"tag":204,"props":387,"children":389},{"class":206,"line":388},7,[390],{"type":49,"tag":204,"props":391,"children":392},{"style":211},[393],{"type":63,"value":394},"# Find trace decorator usage\n",{"type":49,"tag":204,"props":396,"children":398},{"class":206,"line":397},8,[399,403,407,411,416,420,424,428,432,436,440,444,448,452,456],{"type":49,"tag":204,"props":400,"children":401},{"style":221},[402],{"type":63,"value":224},{"type":49,"tag":204,"props":404,"children":405},{"style":227},[406],{"type":63,"value":230},{"type":49,"tag":204,"props":408,"children":409},{"style":233},[410],{"type":63,"value":236},{"type":49,"tag":204,"props":412,"children":413},{"style":227},[414],{"type":63,"value":415},"@trace\\|from sentry_sdk import trace\\|from sentry_sdk.tracing import trace",{"type":49,"tag":204,"props":417,"children":418},{"style":233},[419],{"type":63,"value":246},{"type":49,"tag":204,"props":421,"children":422},{"style":227},[423],{"type":63,"value":251},{"type":49,"tag":204,"props":425,"children":426},{"style":233},[427],{"type":63,"value":246},{"type":49,"tag":204,"props":429,"children":430},{"style":227},[431],{"type":63,"value":260},{"type":49,"tag":204,"props":433,"children":434},{"style":233},[435],{"type":63,"value":246},{"type":49,"tag":204,"props":437,"children":438},{"style":227},[439],{"type":63,"value":269},{"type":49,"tag":204,"props":441,"children":442},{"style":233},[443],{"type":63,"value":274},{"type":49,"tag":204,"props":445,"children":446},{"style":227},[447],{"type":63,"value":279},{"type":49,"tag":204,"props":449,"children":450},{"style":233},[451],{"type":63,"value":284},{"type":49,"tag":204,"props":453,"children":454},{"style":221},[455],{"type":63,"value":289},{"type":49,"tag":204,"props":457,"children":458},{"style":227},[459],{"type":63,"value":294},{"type":49,"tag":204,"props":461,"children":463},{"class":206,"line":462},9,[464],{"type":49,"tag":204,"props":465,"children":466},{"emptyLinePlaceholder":43},[467],{"type":63,"value":303},{"type":49,"tag":204,"props":469,"children":471},{"class":206,"line":470},10,[472],{"type":49,"tag":204,"props":473,"children":474},{"style":211},[475],{"type":63,"value":476},"# Find continue_trace usage\n",{"type":49,"tag":204,"props":478,"children":480},{"class":206,"line":479},11,[481,485,489,493,498,502,506,510,514,518,522,526,530,534,538],{"type":49,"tag":204,"props":482,"children":483},{"style":221},[484],{"type":63,"value":224},{"type":49,"tag":204,"props":486,"children":487},{"style":227},[488],{"type":63,"value":230},{"type":49,"tag":204,"props":490,"children":491},{"style":233},[492],{"type":63,"value":236},{"type":49,"tag":204,"props":494,"children":495},{"style":227},[496],{"type":63,"value":497},"continue_trace",{"type":49,"tag":204,"props":499,"children":500},{"style":233},[501],{"type":63,"value":246},{"type":49,"tag":204,"props":503,"children":504},{"style":227},[505],{"type":63,"value":251},{"type":49,"tag":204,"props":507,"children":508},{"style":233},[509],{"type":63,"value":246},{"type":49,"tag":204,"props":511,"children":512},{"style":227},[513],{"type":63,"value":260},{"type":49,"tag":204,"props":515,"children":516},{"style":233},[517],{"type":63,"value":246},{"type":49,"tag":204,"props":519,"children":520},{"style":227},[521],{"type":63,"value":269},{"type":49,"tag":204,"props":523,"children":524},{"style":233},[525],{"type":63,"value":274},{"type":49,"tag":204,"props":527,"children":528},{"style":227},[529],{"type":63,"value":279},{"type":49,"tag":204,"props":531,"children":532},{"style":233},[533],{"type":63,"value":284},{"type":49,"tag":204,"props":535,"children":536},{"style":221},[537],{"type":63,"value":289},{"type":49,"tag":204,"props":539,"children":540},{"style":227},[541],{"type":63,"value":294},{"type":49,"tag":204,"props":543,"children":545},{"class":206,"line":544},12,[546],{"type":49,"tag":204,"props":547,"children":548},{"emptyLinePlaceholder":43},[549],{"type":63,"value":303},{"type":49,"tag":204,"props":551,"children":553},{"class":206,"line":552},13,[554],{"type":49,"tag":204,"props":555,"children":556},{"style":211},[557],{"type":63,"value":558},"# Find before_send_transaction usage\n",{"type":49,"tag":204,"props":560,"children":562},{"class":206,"line":561},14,[563,567,571,575,580,584,588,592,596,600,604,608,612,616,620],{"type":49,"tag":204,"props":564,"children":565},{"style":221},[566],{"type":63,"value":224},{"type":49,"tag":204,"props":568,"children":569},{"style":227},[570],{"type":63,"value":230},{"type":49,"tag":204,"props":572,"children":573},{"style":233},[574],{"type":63,"value":236},{"type":49,"tag":204,"props":576,"children":577},{"style":227},[578],{"type":63,"value":579},"before_send_transaction",{"type":49,"tag":204,"props":581,"children":582},{"style":233},[583],{"type":63,"value":246},{"type":49,"tag":204,"props":585,"children":586},{"style":227},[587],{"type":63,"value":251},{"type":49,"tag":204,"props":589,"children":590},{"style":233},[591],{"type":63,"value":246},{"type":49,"tag":204,"props":593,"children":594},{"style":227},[595],{"type":63,"value":260},{"type":49,"tag":204,"props":597,"children":598},{"style":233},[599],{"type":63,"value":246},{"type":49,"tag":204,"props":601,"children":602},{"style":227},[603],{"type":63,"value":269},{"type":49,"tag":204,"props":605,"children":606},{"style":233},[607],{"type":63,"value":274},{"type":49,"tag":204,"props":609,"children":610},{"style":227},[611],{"type":63,"value":279},{"type":49,"tag":204,"props":613,"children":614},{"style":233},[615],{"type":63,"value":284},{"type":49,"tag":204,"props":617,"children":618},{"style":221},[619],{"type":63,"value":289},{"type":49,"tag":204,"props":621,"children":622},{"style":227},[623],{"type":63,"value":294},{"type":49,"tag":204,"props":625,"children":627},{"class":206,"line":626},15,[628],{"type":49,"tag":204,"props":629,"children":630},{"emptyLinePlaceholder":43},[631],{"type":63,"value":303},{"type":49,"tag":204,"props":633,"children":635},{"class":206,"line":634},16,[636],{"type":49,"tag":204,"props":637,"children":638},{"style":211},[639],{"type":63,"value":640},"# Find direct Span \u002F Transaction class imports\n",{"type":49,"tag":204,"props":642,"children":644},{"class":206,"line":643},17,[645,649,653,657,662,666,670,674,678,682,686,690,694,698,702],{"type":49,"tag":204,"props":646,"children":647},{"style":221},[648],{"type":63,"value":224},{"type":49,"tag":204,"props":650,"children":651},{"style":227},[652],{"type":63,"value":230},{"type":49,"tag":204,"props":654,"children":655},{"style":233},[656],{"type":63,"value":236},{"type":49,"tag":204,"props":658,"children":659},{"style":227},[660],{"type":63,"value":661},"from sentry_sdk.tracing import\\|from sentry_sdk import.*Span\\|from sentry_sdk import.*Transaction",{"type":49,"tag":204,"props":663,"children":664},{"style":233},[665],{"type":63,"value":246},{"type":49,"tag":204,"props":667,"children":668},{"style":227},[669],{"type":63,"value":251},{"type":49,"tag":204,"props":671,"children":672},{"style":233},[673],{"type":63,"value":246},{"type":49,"tag":204,"props":675,"children":676},{"style":227},[677],{"type":63,"value":260},{"type":49,"tag":204,"props":679,"children":680},{"style":233},[681],{"type":63,"value":246},{"type":49,"tag":204,"props":683,"children":684},{"style":227},[685],{"type":63,"value":269},{"type":49,"tag":204,"props":687,"children":688},{"style":233},[689],{"type":63,"value":274},{"type":49,"tag":204,"props":691,"children":692},{"style":227},[693],{"type":63,"value":279},{"type":49,"tag":204,"props":695,"children":696},{"style":233},[697],{"type":63,"value":284},{"type":49,"tag":204,"props":699,"children":700},{"style":221},[701],{"type":63,"value":289},{"type":49,"tag":204,"props":703,"children":704},{"style":227},[705],{"type":63,"value":294},{"type":49,"tag":204,"props":707,"children":709},{"class":206,"line":708},18,[710],{"type":49,"tag":204,"props":711,"children":712},{"emptyLinePlaceholder":43},[713],{"type":63,"value":303},{"type":49,"tag":204,"props":715,"children":717},{"class":206,"line":716},19,[718],{"type":49,"tag":204,"props":719,"children":720},{"style":211},[721],{"type":63,"value":722},"# Find set_data \u002F set_tag \u002F set_context on spans\n",{"type":49,"tag":204,"props":724,"children":726},{"class":206,"line":725},20,[727,731,735,739,744,748,752,756,760,764,768,772,776,780,784],{"type":49,"tag":204,"props":728,"children":729},{"style":221},[730],{"type":63,"value":224},{"type":49,"tag":204,"props":732,"children":733},{"style":227},[734],{"type":63,"value":230},{"type":49,"tag":204,"props":736,"children":737},{"style":233},[738],{"type":63,"value":236},{"type":49,"tag":204,"props":740,"children":741},{"style":227},[742],{"type":63,"value":743},"set_data\\|set_tag\\|set_context",{"type":49,"tag":204,"props":745,"children":746},{"style":233},[747],{"type":63,"value":246},{"type":49,"tag":204,"props":749,"children":750},{"style":227},[751],{"type":63,"value":251},{"type":49,"tag":204,"props":753,"children":754},{"style":233},[755],{"type":63,"value":246},{"type":49,"tag":204,"props":757,"children":758},{"style":227},[759],{"type":63,"value":260},{"type":49,"tag":204,"props":761,"children":762},{"style":233},[763],{"type":63,"value":246},{"type":49,"tag":204,"props":765,"children":766},{"style":227},[767],{"type":63,"value":269},{"type":49,"tag":204,"props":769,"children":770},{"style":233},[771],{"type":63,"value":274},{"type":49,"tag":204,"props":773,"children":774},{"style":227},[775],{"type":63,"value":279},{"type":49,"tag":204,"props":777,"children":778},{"style":233},[779],{"type":63,"value":284},{"type":49,"tag":204,"props":781,"children":782},{"style":221},[783],{"type":63,"value":289},{"type":49,"tag":204,"props":785,"children":786},{"style":227},[787],{"type":63,"value":294},{"type":49,"tag":204,"props":789,"children":791},{"class":206,"line":790},21,[792],{"type":49,"tag":204,"props":793,"children":794},{"emptyLinePlaceholder":43},[795],{"type":63,"value":303},{"type":49,"tag":204,"props":797,"children":799},{"class":206,"line":798},22,[800],{"type":49,"tag":204,"props":801,"children":802},{"style":211},[803],{"type":63,"value":804},"# Find scope.span \u002F scope.transaction \u002F containing_transaction access\n",{"type":49,"tag":204,"props":806,"children":808},{"class":206,"line":807},23,[809,813,817,821,826,830,834,838,842,846,850,854,858,862,866],{"type":49,"tag":204,"props":810,"children":811},{"style":221},[812],{"type":63,"value":224},{"type":49,"tag":204,"props":814,"children":815},{"style":227},[816],{"type":63,"value":230},{"type":49,"tag":204,"props":818,"children":819},{"style":233},[820],{"type":63,"value":236},{"type":49,"tag":204,"props":822,"children":823},{"style":227},[824],{"type":63,"value":825},"scope\\.span\\|scope\\.transaction\\|containing_transaction",{"type":49,"tag":204,"props":827,"children":828},{"style":233},[829],{"type":63,"value":246},{"type":49,"tag":204,"props":831,"children":832},{"style":227},[833],{"type":63,"value":251},{"type":49,"tag":204,"props":835,"children":836},{"style":233},[837],{"type":63,"value":246},{"type":49,"tag":204,"props":839,"children":840},{"style":227},[841],{"type":63,"value":260},{"type":49,"tag":204,"props":843,"children":844},{"style":233},[845],{"type":63,"value":246},{"type":49,"tag":204,"props":847,"children":848},{"style":227},[849],{"type":63,"value":269},{"type":49,"tag":204,"props":851,"children":852},{"style":233},[853],{"type":63,"value":274},{"type":49,"tag":204,"props":855,"children":856},{"style":227},[857],{"type":63,"value":279},{"type":49,"tag":204,"props":859,"children":860},{"style":233},[861],{"type":63,"value":284},{"type":49,"tag":204,"props":863,"children":864},{"style":221},[865],{"type":63,"value":289},{"type":49,"tag":204,"props":867,"children":868},{"style":227},[869],{"type":63,"value":294},{"type":49,"tag":204,"props":871,"children":873},{"class":206,"line":872},24,[874],{"type":49,"tag":204,"props":875,"children":876},{"emptyLinePlaceholder":43},[877],{"type":63,"value":303},{"type":49,"tag":204,"props":879,"children":881},{"class":206,"line":880},25,[882],{"type":49,"tag":204,"props":883,"children":884},{"style":211},[885],{"type":63,"value":886},"# Find get_trace_context usage\n",{"type":49,"tag":204,"props":888,"children":890},{"class":206,"line":889},26,[891,895,899,903,908,912,916,920,924,928,932,936,940,944,948],{"type":49,"tag":204,"props":892,"children":893},{"style":221},[894],{"type":63,"value":224},{"type":49,"tag":204,"props":896,"children":897},{"style":227},[898],{"type":63,"value":230},{"type":49,"tag":204,"props":900,"children":901},{"style":233},[902],{"type":63,"value":236},{"type":49,"tag":204,"props":904,"children":905},{"style":227},[906],{"type":63,"value":907},"get_trace_context",{"type":49,"tag":204,"props":909,"children":910},{"style":233},[911],{"type":63,"value":246},{"type":49,"tag":204,"props":913,"children":914},{"style":227},[915],{"type":63,"value":251},{"type":49,"tag":204,"props":917,"children":918},{"style":233},[919],{"type":63,"value":246},{"type":49,"tag":204,"props":921,"children":922},{"style":227},[923],{"type":63,"value":260},{"type":49,"tag":204,"props":925,"children":926},{"style":233},[927],{"type":63,"value":246},{"type":49,"tag":204,"props":929,"children":930},{"style":227},[931],{"type":63,"value":269},{"type":49,"tag":204,"props":933,"children":934},{"style":233},[935],{"type":63,"value":274},{"type":49,"tag":204,"props":937,"children":938},{"style":227},[939],{"type":63,"value":279},{"type":49,"tag":204,"props":941,"children":942},{"style":233},[943],{"type":63,"value":284},{"type":49,"tag":204,"props":945,"children":946},{"style":221},[947],{"type":63,"value":289},{"type":49,"tag":204,"props":949,"children":950},{"style":227},[951],{"type":63,"value":294},{"type":49,"tag":186,"props":953,"children":955},{"id":954},"parallelization",[956],{"type":63,"value":957},"Parallelization",{"type":49,"tag":54,"props":959,"children":960},{},[961,963,968,969,975,976,982],{"type":63,"value":962},"After detecting the environment, assess how many files need changes. If the codebase has many files to migrate (e.g. dozens of files with ",{"type":49,"tag":88,"props":964,"children":966},{"className":965},[],[967],{"type":63,"value":173},{"type":63,"value":159},{"type":49,"tag":88,"props":970,"children":972},{"className":971},[],[973],{"type":63,"value":974},"start_transaction",{"type":63,"value":159},{"type":49,"tag":88,"props":977,"children":979},{"className":978},[],[980],{"type":63,"value":981},"set_data",{"type":63,"value":983},", etc.), launch subagents to handle independent migration tasks in parallel — for example, one subagent per migration category (span creation, span data, trace propagation) or per module\u002Fpackage. Each subagent should receive the relevant migration rules from this skill and operate on a distinct set of files.",{"type":49,"tag":186,"props":985,"children":987},{"id":986},"enable-span-streaming",[988],{"type":63,"value":989},"Enable Span Streaming",{"type":49,"tag":54,"props":991,"children":992},{},[993,999,1001,1007,1008,1014,1016,1022,1024,1030],{"type":49,"tag":994,"props":995,"children":996},"strong",{},[997],{"type":63,"value":998},"Prerequisites:",{"type":63,"value":1000}," ",{"type":49,"tag":88,"props":1002,"children":1004},{"className":1003},[],[1005],{"type":63,"value":1006},"sentry-sdk",{"type":63,"value":1000},{"type":49,"tag":88,"props":1009,"children":1011},{"className":1010},[],[1012],{"type":63,"value":1013},">=2.66.0",{"type":63,"value":1015}," with tracing enabled (",{"type":49,"tag":88,"props":1017,"children":1019},{"className":1018},[],[1020],{"type":63,"value":1021},"traces_sample_rate",{"type":63,"value":1023}," or ",{"type":49,"tag":88,"props":1025,"children":1027},{"className":1026},[],[1028],{"type":63,"value":1029},"traces_sampler",{"type":63,"value":1031}," configured).",{"type":49,"tag":54,"props":1033,"children":1034},{},[1035,1037,1042,1044,1050],{"type":63,"value":1036},"Add the top-level ",{"type":49,"tag":88,"props":1038,"children":1040},{"className":1039},[],[1041],{"type":63,"value":157},{"type":63,"value":1043}," option in ALL occurences of ",{"type":49,"tag":88,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":63,"value":1049},"sentry_sdk.init()",{"type":63,"value":1051},":",{"type":49,"tag":193,"props":1053,"children":1056},{"className":1054,"code":1055,"language":25,"meta":198,"style":198},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import sentry_sdk\n\n# Before\nsentry_sdk.init(\n    dsn=\"...\",\n    traces_sample_rate=1.0,\n)\n\n# After\nsentry_sdk.init(\n    dsn=\"...\",\n    traces_sample_rate=1.0,\n    trace_lifecycle=\"stream\",\n)\n",[1057],{"type":49,"tag":88,"props":1058,"children":1059},{"__ignoreMap":198},[1060,1068,1075,1083,1091,1099,1107,1115,1122,1130,1137,1144,1151,1159],{"type":49,"tag":204,"props":1061,"children":1062},{"class":206,"line":207},[1063],{"type":49,"tag":204,"props":1064,"children":1065},{},[1066],{"type":63,"value":1067},"import sentry_sdk\n",{"type":49,"tag":204,"props":1069,"children":1070},{"class":206,"line":217},[1071],{"type":49,"tag":204,"props":1072,"children":1073},{"emptyLinePlaceholder":43},[1074],{"type":63,"value":303},{"type":49,"tag":204,"props":1076,"children":1077},{"class":206,"line":297},[1078],{"type":49,"tag":204,"props":1079,"children":1080},{},[1081],{"type":63,"value":1082},"# Before\n",{"type":49,"tag":204,"props":1084,"children":1085},{"class":206,"line":306},[1086],{"type":49,"tag":204,"props":1087,"children":1088},{},[1089],{"type":63,"value":1090},"sentry_sdk.init(\n",{"type":49,"tag":204,"props":1092,"children":1093},{"class":206,"line":315},[1094],{"type":49,"tag":204,"props":1095,"children":1096},{},[1097],{"type":63,"value":1098},"    dsn=\"...\",\n",{"type":49,"tag":204,"props":1100,"children":1101},{"class":206,"line":380},[1102],{"type":49,"tag":204,"props":1103,"children":1104},{},[1105],{"type":63,"value":1106},"    traces_sample_rate=1.0,\n",{"type":49,"tag":204,"props":1108,"children":1109},{"class":206,"line":388},[1110],{"type":49,"tag":204,"props":1111,"children":1112},{},[1113],{"type":63,"value":1114},")\n",{"type":49,"tag":204,"props":1116,"children":1117},{"class":206,"line":397},[1118],{"type":49,"tag":204,"props":1119,"children":1120},{"emptyLinePlaceholder":43},[1121],{"type":63,"value":303},{"type":49,"tag":204,"props":1123,"children":1124},{"class":206,"line":462},[1125],{"type":49,"tag":204,"props":1126,"children":1127},{},[1128],{"type":63,"value":1129},"# After\n",{"type":49,"tag":204,"props":1131,"children":1132},{"class":206,"line":470},[1133],{"type":49,"tag":204,"props":1134,"children":1135},{},[1136],{"type":63,"value":1090},{"type":49,"tag":204,"props":1138,"children":1139},{"class":206,"line":479},[1140],{"type":49,"tag":204,"props":1141,"children":1142},{},[1143],{"type":63,"value":1098},{"type":49,"tag":204,"props":1145,"children":1146},{"class":206,"line":544},[1147],{"type":49,"tag":204,"props":1148,"children":1149},{},[1150],{"type":63,"value":1106},{"type":49,"tag":204,"props":1152,"children":1153},{"class":206,"line":552},[1154],{"type":49,"tag":204,"props":1155,"children":1156},{},[1157],{"type":63,"value":1158},"    trace_lifecycle=\"stream\",\n",{"type":49,"tag":204,"props":1160,"children":1161},{"class":206,"line":561},[1162],{"type":49,"tag":204,"props":1163,"children":1164},{},[1165],{"type":63,"value":1114},{"type":49,"tag":54,"props":1167,"children":1168},{},[1169,1171,1177,1179,1185,1187,1193],{"type":63,"value":1170},"Span streaming requires using the new ",{"type":49,"tag":88,"props":1172,"children":1174},{"className":1173},[],[1175],{"type":63,"value":1176},"sentry_sdk.traces.start_span",{"type":63,"value":1178}," API. The legacy ",{"type":49,"tag":88,"props":1180,"children":1182},{"className":1181},[],[1183],{"type":63,"value":1184},"sentry_sdk.start_span",{"type":63,"value":1186}," and ",{"type":49,"tag":88,"props":1188,"children":1190},{"className":1189},[],[1191],{"type":63,"value":1192},"sentry_sdk.start_transaction",{"type":63,"value":1194}," APIs will not stream spans.",{"type":49,"tag":186,"props":1196,"children":1198},{"id":1197},"migrate-span-creation",[1199],{"type":63,"value":1200},"Migrate Span Creation",{"type":49,"tag":1202,"props":1203,"children":1204},"h4",{"id":173},[1205],{"type":49,"tag":88,"props":1206,"children":1208},{"className":1207},[],[1209],{"type":63,"value":173},{"type":49,"tag":54,"props":1211,"children":1212},{},[1213,1215,1221,1223,1229],{"type":63,"value":1214},"Replace ",{"type":49,"tag":88,"props":1216,"children":1218},{"className":1217},[],[1219],{"type":63,"value":1220},"sentry_sdk.start_span()",{"type":63,"value":1222}," with ",{"type":49,"tag":88,"props":1224,"children":1226},{"className":1225},[],[1227],{"type":63,"value":1228},"sentry_sdk.traces.start_span()",{"type":63,"value":1051},{"type":49,"tag":193,"props":1231,"children":1233},{"className":1054,"code":1232,"language":25,"meta":198,"style":198},"import sentry_sdk\n\n# Before\nwith sentry_sdk.start_span(name=\"flow.checkout\") as span:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"flow.checkout\") as span:\n    ...\n",[1234],{"type":49,"tag":88,"props":1235,"children":1236},{"__ignoreMap":198},[1237,1244,1251,1258,1266,1274,1281,1288,1296],{"type":49,"tag":204,"props":1238,"children":1239},{"class":206,"line":207},[1240],{"type":49,"tag":204,"props":1241,"children":1242},{},[1243],{"type":63,"value":1067},{"type":49,"tag":204,"props":1245,"children":1246},{"class":206,"line":217},[1247],{"type":49,"tag":204,"props":1248,"children":1249},{"emptyLinePlaceholder":43},[1250],{"type":63,"value":303},{"type":49,"tag":204,"props":1252,"children":1253},{"class":206,"line":297},[1254],{"type":49,"tag":204,"props":1255,"children":1256},{},[1257],{"type":63,"value":1082},{"type":49,"tag":204,"props":1259,"children":1260},{"class":206,"line":306},[1261],{"type":49,"tag":204,"props":1262,"children":1263},{},[1264],{"type":63,"value":1265},"with sentry_sdk.start_span(name=\"flow.checkout\") as span:\n",{"type":49,"tag":204,"props":1267,"children":1268},{"class":206,"line":315},[1269],{"type":49,"tag":204,"props":1270,"children":1271},{},[1272],{"type":63,"value":1273},"    ...\n",{"type":49,"tag":204,"props":1275,"children":1276},{"class":206,"line":380},[1277],{"type":49,"tag":204,"props":1278,"children":1279},{"emptyLinePlaceholder":43},[1280],{"type":63,"value":303},{"type":49,"tag":204,"props":1282,"children":1283},{"class":206,"line":388},[1284],{"type":49,"tag":204,"props":1285,"children":1286},{},[1287],{"type":63,"value":1129},{"type":49,"tag":204,"props":1289,"children":1290},{"class":206,"line":397},[1291],{"type":49,"tag":204,"props":1292,"children":1293},{},[1294],{"type":63,"value":1295},"with sentry_sdk.traces.start_span(name=\"flow.checkout\") as span:\n",{"type":49,"tag":204,"props":1297,"children":1298},{"class":206,"line":462},[1299],{"type":49,"tag":204,"props":1300,"children":1301},{},[1302],{"type":63,"value":1273},{"type":49,"tag":54,"props":1304,"children":1305},{},[1306],{"type":63,"value":1307},"Or change the import:",{"type":49,"tag":193,"props":1309,"children":1311},{"className":1054,"code":1310,"language":25,"meta":198,"style":198},"# Before\nfrom sentry_sdk import start_span\n\n# After\nfrom sentry_sdk.traces import start_span\n",[1312],{"type":49,"tag":88,"props":1313,"children":1314},{"__ignoreMap":198},[1315,1322,1330,1337,1344],{"type":49,"tag":204,"props":1316,"children":1317},{"class":206,"line":207},[1318],{"type":49,"tag":204,"props":1319,"children":1320},{},[1321],{"type":63,"value":1082},{"type":49,"tag":204,"props":1323,"children":1324},{"class":206,"line":217},[1325],{"type":49,"tag":204,"props":1326,"children":1327},{},[1328],{"type":63,"value":1329},"from sentry_sdk import start_span\n",{"type":49,"tag":204,"props":1331,"children":1332},{"class":206,"line":297},[1333],{"type":49,"tag":204,"props":1334,"children":1335},{"emptyLinePlaceholder":43},[1336],{"type":63,"value":303},{"type":49,"tag":204,"props":1338,"children":1339},{"class":206,"line":306},[1340],{"type":49,"tag":204,"props":1341,"children":1342},{},[1343],{"type":63,"value":1129},{"type":49,"tag":204,"props":1345,"children":1346},{"class":206,"line":315},[1347],{"type":49,"tag":204,"props":1348,"children":1349},{},[1350],{"type":63,"value":1351},"from sentry_sdk.traces import start_span\n",{"type":49,"tag":54,"props":1353,"children":1354},{},[1355],{"type":63,"value":1356},"The new API accepts:",{"type":49,"tag":133,"props":1358,"children":1359},{},[1360,1371,1382,1393],{"type":49,"tag":137,"props":1361,"children":1362},{},[1363,1369],{"type":49,"tag":88,"props":1364,"children":1366},{"className":1365},[],[1367],{"type":63,"value":1368},"name",{"type":63,"value":1370}," (required)",{"type":49,"tag":137,"props":1372,"children":1373},{},[1374,1380],{"type":49,"tag":88,"props":1375,"children":1377},{"className":1376},[],[1378],{"type":63,"value":1379},"attributes",{"type":63,"value":1381}," — key-value pairs (see Migrate Span Data below)",{"type":49,"tag":137,"props":1383,"children":1384},{},[1385,1391],{"type":49,"tag":88,"props":1386,"children":1388},{"className":1387},[],[1389],{"type":63,"value":1390},"parent_span",{"type":63,"value":1392}," — explicit parent span; defaults to the currently active span",{"type":49,"tag":137,"props":1394,"children":1395},{},[1396,1402,1404,1410,1412,1418],{"type":49,"tag":88,"props":1397,"children":1399},{"className":1398},[],[1400],{"type":63,"value":1401},"active",{"type":63,"value":1403}," — defaults to ",{"type":49,"tag":88,"props":1405,"children":1407},{"className":1406},[],[1408],{"type":63,"value":1409},"True",{"type":63,"value":1411},"; if ",{"type":49,"tag":88,"props":1413,"children":1415},{"className":1414},[],[1416],{"type":63,"value":1417},"False",{"type":63,"value":1419},", the span won't become other spans' parent automatically",{"type":49,"tag":54,"props":1421,"children":1422},{},[1423,1425,1431,1433,1438,1440,1446,1448,1454],{"type":63,"value":1424},"The ",{"type":49,"tag":88,"props":1426,"children":1428},{"className":1427},[],[1429],{"type":63,"value":1430},"description",{"type":63,"value":1432}," argument no longer exists — use ",{"type":49,"tag":88,"props":1434,"children":1436},{"className":1435},[],[1437],{"type":63,"value":1368},{"type":63,"value":1439}," instead. The ",{"type":49,"tag":88,"props":1441,"children":1443},{"className":1442},[],[1444],{"type":63,"value":1445},"op",{"type":63,"value":1447}," argument is no longer supported — use the ",{"type":49,"tag":88,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":63,"value":1453},"sentry.op",{"type":63,"value":1455}," attribute instead:",{"type":49,"tag":193,"props":1457,"children":1459},{"className":1054,"code":1458,"language":25,"meta":198,"style":198},"# Before\nwith sentry_sdk.start_span(op=\"http.client\", description=\"GET \u002Fapi\u002Fusers\") as span:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(\n    name=\"GET \u002Fapi\u002Fusers\",\n    attributes={\"sentry.op\": \"http.client\"},\n) as span:\n    ...\n",[1460],{"type":49,"tag":88,"props":1461,"children":1462},{"__ignoreMap":198},[1463,1470,1478,1485,1492,1499,1507,1515,1523,1531],{"type":49,"tag":204,"props":1464,"children":1465},{"class":206,"line":207},[1466],{"type":49,"tag":204,"props":1467,"children":1468},{},[1469],{"type":63,"value":1082},{"type":49,"tag":204,"props":1471,"children":1472},{"class":206,"line":217},[1473],{"type":49,"tag":204,"props":1474,"children":1475},{},[1476],{"type":63,"value":1477},"with sentry_sdk.start_span(op=\"http.client\", description=\"GET \u002Fapi\u002Fusers\") as span:\n",{"type":49,"tag":204,"props":1479,"children":1480},{"class":206,"line":297},[1481],{"type":49,"tag":204,"props":1482,"children":1483},{},[1484],{"type":63,"value":1273},{"type":49,"tag":204,"props":1486,"children":1487},{"class":206,"line":306},[1488],{"type":49,"tag":204,"props":1489,"children":1490},{"emptyLinePlaceholder":43},[1491],{"type":63,"value":303},{"type":49,"tag":204,"props":1493,"children":1494},{"class":206,"line":315},[1495],{"type":49,"tag":204,"props":1496,"children":1497},{},[1498],{"type":63,"value":1129},{"type":49,"tag":204,"props":1500,"children":1501},{"class":206,"line":380},[1502],{"type":49,"tag":204,"props":1503,"children":1504},{},[1505],{"type":63,"value":1506},"with sentry_sdk.traces.start_span(\n",{"type":49,"tag":204,"props":1508,"children":1509},{"class":206,"line":388},[1510],{"type":49,"tag":204,"props":1511,"children":1512},{},[1513],{"type":63,"value":1514},"    name=\"GET \u002Fapi\u002Fusers\",\n",{"type":49,"tag":204,"props":1516,"children":1517},{"class":206,"line":397},[1518],{"type":49,"tag":204,"props":1519,"children":1520},{},[1521],{"type":63,"value":1522},"    attributes={\"sentry.op\": \"http.client\"},\n",{"type":49,"tag":204,"props":1524,"children":1525},{"class":206,"line":462},[1526],{"type":49,"tag":204,"props":1527,"children":1528},{},[1529],{"type":63,"value":1530},") as span:\n",{"type":49,"tag":204,"props":1532,"children":1533},{"class":206,"line":470},[1534],{"type":49,"tag":204,"props":1535,"children":1536},{},[1537],{"type":63,"value":1273},{"type":49,"tag":1202,"props":1539,"children":1540},{"id":974},[1541],{"type":49,"tag":88,"props":1542,"children":1544},{"className":1543},[],[1545],{"type":63,"value":974},{"type":49,"tag":54,"props":1547,"children":1548},{},[1549,1550,1556,1557,1562],{"type":63,"value":1214},{"type":49,"tag":88,"props":1551,"children":1553},{"className":1552},[],[1554],{"type":63,"value":1555},"sentry_sdk.start_transaction()",{"type":63,"value":1222},{"type":49,"tag":88,"props":1558,"children":1560},{"className":1559},[],[1561],{"type":63,"value":1228},{"type":63,"value":1051},{"type":49,"tag":193,"props":1564,"children":1566},{"className":1054,"code":1565,"language":25,"meta":198,"style":198},"import sentry_sdk\n\n# Before\nwith sentry_sdk.start_transaction(name=\"flow.checkout\") as transaction:\n    ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"flow.checkout\", parent_span=None) as span:\n    ...\n",[1567],{"type":49,"tag":88,"props":1568,"children":1569},{"__ignoreMap":198},[1570,1577,1584,1591,1599,1606,1613,1620,1628],{"type":49,"tag":204,"props":1571,"children":1572},{"class":206,"line":207},[1573],{"type":49,"tag":204,"props":1574,"children":1575},{},[1576],{"type":63,"value":1067},{"type":49,"tag":204,"props":1578,"children":1579},{"class":206,"line":217},[1580],{"type":49,"tag":204,"props":1581,"children":1582},{"emptyLinePlaceholder":43},[1583],{"type":63,"value":303},{"type":49,"tag":204,"props":1585,"children":1586},{"class":206,"line":297},[1587],{"type":49,"tag":204,"props":1588,"children":1589},{},[1590],{"type":63,"value":1082},{"type":49,"tag":204,"props":1592,"children":1593},{"class":206,"line":306},[1594],{"type":49,"tag":204,"props":1595,"children":1596},{},[1597],{"type":63,"value":1598},"with sentry_sdk.start_transaction(name=\"flow.checkout\") as transaction:\n",{"type":49,"tag":204,"props":1600,"children":1601},{"class":206,"line":315},[1602],{"type":49,"tag":204,"props":1603,"children":1604},{},[1605],{"type":63,"value":1273},{"type":49,"tag":204,"props":1607,"children":1608},{"class":206,"line":380},[1609],{"type":49,"tag":204,"props":1610,"children":1611},{"emptyLinePlaceholder":43},[1612],{"type":63,"value":303},{"type":49,"tag":204,"props":1614,"children":1615},{"class":206,"line":388},[1616],{"type":49,"tag":204,"props":1617,"children":1618},{},[1619],{"type":63,"value":1129},{"type":49,"tag":204,"props":1621,"children":1622},{"class":206,"line":397},[1623],{"type":49,"tag":204,"props":1624,"children":1625},{},[1626],{"type":63,"value":1627},"with sentry_sdk.traces.start_span(name=\"flow.checkout\", parent_span=None) as span:\n",{"type":49,"tag":204,"props":1629,"children":1630},{"class":206,"line":462},[1631],{"type":49,"tag":204,"props":1632,"children":1633},{},[1634],{"type":63,"value":1273},{"type":49,"tag":54,"props":1636,"children":1637},{},[1638,1640,1646],{"type":63,"value":1639},"Setting ",{"type":49,"tag":88,"props":1641,"children":1643},{"className":1642},[],[1644],{"type":63,"value":1645},"parent_span=None",{"type":63,"value":1647}," forces the span to become a root span, which is the equivalent of starting a transaction in the legacy API.",{"type":49,"tag":1202,"props":1649,"children":1651},{"id":1650},"start_child",[1652],{"type":49,"tag":88,"props":1653,"children":1655},{"className":1654},[],[1656],{"type":63,"value":1650},{"type":49,"tag":54,"props":1658,"children":1659},{},[1660,1666],{"type":49,"tag":88,"props":1661,"children":1663},{"className":1662},[],[1664],{"type":63,"value":1665},"span.start_child()",{"type":63,"value":1667}," no longer exists. Start a new span while the parent is active — it becomes a child automatically:",{"type":49,"tag":193,"props":1669,"children":1671},{"className":1054,"code":1670,"language":25,"meta":198,"style":198},"import sentry_sdk\n\n# Before\nwith sentry_sdk.start_span(name=\"outer\") as parent:\n    with parent.start_child(op=\"db\", description=\"SELECT\") as child:\n        ...\n\n# After\nwith sentry_sdk.traces.start_span(name=\"outer\") as parent:\n    with sentry_sdk.traces.start_span(\n        name=\"SELECT\",\n        attributes={\"sentry.op\": \"db\"},\n    ):\n        ...\n",[1672],{"type":49,"tag":88,"props":1673,"children":1674},{"__ignoreMap":198},[1675,1682,1689,1696,1704,1712,1720,1727,1734,1742,1750,1758,1766,1774],{"type":49,"tag":204,"props":1676,"children":1677},{"class":206,"line":207},[1678],{"type":49,"tag":204,"props":1679,"children":1680},{},[1681],{"type":63,"value":1067},{"type":49,"tag":204,"props":1683,"children":1684},{"class":206,"line":217},[1685],{"type":49,"tag":204,"props":1686,"children":1687},{"emptyLinePlaceholder":43},[1688],{"type":63,"value":303},{"type":49,"tag":204,"props":1690,"children":1691},{"class":206,"line":297},[1692],{"type":49,"tag":204,"props":1693,"children":1694},{},[1695],{"type":63,"value":1082},{"type":49,"tag":204,"props":1697,"children":1698},{"class":206,"line":306},[1699],{"type":49,"tag":204,"props":1700,"children":1701},{},[1702],{"type":63,"value":1703},"with sentry_sdk.start_span(name=\"outer\") as parent:\n",{"type":49,"tag":204,"props":1705,"children":1706},{"class":206,"line":315},[1707],{"type":49,"tag":204,"props":1708,"children":1709},{},[1710],{"type":63,"value":1711},"    with parent.start_child(op=\"db\", description=\"SELECT\") as child:\n",{"type":49,"tag":204,"props":1713,"children":1714},{"class":206,"line":380},[1715],{"type":49,"tag":204,"props":1716,"children":1717},{},[1718],{"type":63,"value":1719},"        ...\n",{"type":49,"tag":204,"props":1721,"children":1722},{"class":206,"line":388},[1723],{"type":49,"tag":204,"props":1724,"children":1725},{"emptyLinePlaceholder":43},[1726],{"type":63,"value":303},{"type":49,"tag":204,"props":1728,"children":1729},{"class":206,"line":397},[1730],{"type":49,"tag":204,"props":1731,"children":1732},{},[1733],{"type":63,"value":1129},{"type":49,"tag":204,"props":1735,"children":1736},{"class":206,"line":462},[1737],{"type":49,"tag":204,"props":1738,"children":1739},{},[1740],{"type":63,"value":1741},"with sentry_sdk.traces.start_span(name=\"outer\") as parent:\n",{"type":49,"tag":204,"props":1743,"children":1744},{"class":206,"line":470},[1745],{"type":49,"tag":204,"props":1746,"children":1747},{},[1748],{"type":63,"value":1749},"    with sentry_sdk.traces.start_span(\n",{"type":49,"tag":204,"props":1751,"children":1752},{"class":206,"line":479},[1753],{"type":49,"tag":204,"props":1754,"children":1755},{},[1756],{"type":63,"value":1757},"        name=\"SELECT\",\n",{"type":49,"tag":204,"props":1759,"children":1760},{"class":206,"line":544},[1761],{"type":49,"tag":204,"props":1762,"children":1763},{},[1764],{"type":63,"value":1765},"        attributes={\"sentry.op\": \"db\"},\n",{"type":49,"tag":204,"props":1767,"children":1768},{"class":206,"line":552},[1769],{"type":49,"tag":204,"props":1770,"children":1771},{},[1772],{"type":63,"value":1773},"    ):\n",{"type":49,"tag":204,"props":1775,"children":1776},{"class":206,"line":561},[1777],{"type":49,"tag":204,"props":1778,"children":1779},{},[1780],{"type":63,"value":1719},{"type":49,"tag":54,"props":1782,"children":1783},{},[1784,1786,1791],{"type":63,"value":1785},"To control parentage explicitly (e.g. make a span a sibling rather than a child), use ",{"type":49,"tag":88,"props":1787,"children":1789},{"className":1788},[],[1790],{"type":63,"value":1390},{"type":63,"value":1051},{"type":49,"tag":193,"props":1793,"children":1795},{"className":1054,"code":1794,"language":25,"meta":198,"style":198},"with sentry_sdk.traces.start_span(name=\"outer\") as span:\n    with sentry_sdk.traces.start_span(name=\"child 1\"):\n        with sentry_sdk.traces.start_span(name=\"child 2\", parent_span=span):\n            # \"child 2\" is a sibling of \"child 1\", not its child\n            ...\n",[1796],{"type":49,"tag":88,"props":1797,"children":1798},{"__ignoreMap":198},[1799,1807,1815,1823,1831],{"type":49,"tag":204,"props":1800,"children":1801},{"class":206,"line":207},[1802],{"type":49,"tag":204,"props":1803,"children":1804},{},[1805],{"type":63,"value":1806},"with sentry_sdk.traces.start_span(name=\"outer\") as span:\n",{"type":49,"tag":204,"props":1808,"children":1809},{"class":206,"line":217},[1810],{"type":49,"tag":204,"props":1811,"children":1812},{},[1813],{"type":63,"value":1814},"    with sentry_sdk.traces.start_span(name=\"child 1\"):\n",{"type":49,"tag":204,"props":1816,"children":1817},{"class":206,"line":297},[1818],{"type":49,"tag":204,"props":1819,"children":1820},{},[1821],{"type":63,"value":1822},"        with sentry_sdk.traces.start_span(name=\"child 2\", parent_span=span):\n",{"type":49,"tag":204,"props":1824,"children":1825},{"class":206,"line":306},[1826],{"type":49,"tag":204,"props":1827,"children":1828},{},[1829],{"type":63,"value":1830},"            # \"child 2\" is a sibling of \"child 1\", not its child\n",{"type":49,"tag":204,"props":1832,"children":1833},{"class":206,"line":315},[1834],{"type":49,"tag":204,"props":1835,"children":1836},{},[1837],{"type":63,"value":1838},"            ...\n",{"type":49,"tag":1202,"props":1840,"children":1842},{"id":1841},"trace-decorator",[1843,1849],{"type":49,"tag":88,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":63,"value":1848},"@trace",{"type":63,"value":1850}," Decorator",{"type":49,"tag":54,"props":1852,"children":1853},{},[1854,1855,1861,1862,1868],{"type":63,"value":1214},{"type":49,"tag":88,"props":1856,"children":1858},{"className":1857},[],[1859],{"type":63,"value":1860},"sentry_sdk.trace",{"type":63,"value":1222},{"type":49,"tag":88,"props":1863,"children":1865},{"className":1864},[],[1866],{"type":63,"value":1867},"sentry_sdk.traces.trace",{"type":63,"value":1051},{"type":49,"tag":193,"props":1870,"children":1872},{"className":1054,"code":1871,"language":25,"meta":198,"style":198},"# Before\nfrom sentry_sdk import trace\n\n@trace\ndef checkout():\n    ...\n\n# After — just change the import\nfrom sentry_sdk.traces import trace\n\n@trace\ndef checkout():\n    ...\n",[1873],{"type":49,"tag":88,"props":1874,"children":1875},{"__ignoreMap":198},[1876,1883,1891,1898,1906,1914,1921,1928,1936,1944,1951,1958,1965],{"type":49,"tag":204,"props":1877,"children":1878},{"class":206,"line":207},[1879],{"type":49,"tag":204,"props":1880,"children":1881},{},[1882],{"type":63,"value":1082},{"type":49,"tag":204,"props":1884,"children":1885},{"class":206,"line":217},[1886],{"type":49,"tag":204,"props":1887,"children":1888},{},[1889],{"type":63,"value":1890},"from sentry_sdk import trace\n",{"type":49,"tag":204,"props":1892,"children":1893},{"class":206,"line":297},[1894],{"type":49,"tag":204,"props":1895,"children":1896},{"emptyLinePlaceholder":43},[1897],{"type":63,"value":303},{"type":49,"tag":204,"props":1899,"children":1900},{"class":206,"line":306},[1901],{"type":49,"tag":204,"props":1902,"children":1903},{},[1904],{"type":63,"value":1905},"@trace\n",{"type":49,"tag":204,"props":1907,"children":1908},{"class":206,"line":315},[1909],{"type":49,"tag":204,"props":1910,"children":1911},{},[1912],{"type":63,"value":1913},"def checkout():\n",{"type":49,"tag":204,"props":1915,"children":1916},{"class":206,"line":380},[1917],{"type":49,"tag":204,"props":1918,"children":1919},{},[1920],{"type":63,"value":1273},{"type":49,"tag":204,"props":1922,"children":1923},{"class":206,"line":388},[1924],{"type":49,"tag":204,"props":1925,"children":1926},{"emptyLinePlaceholder":43},[1927],{"type":63,"value":303},{"type":49,"tag":204,"props":1929,"children":1930},{"class":206,"line":397},[1931],{"type":49,"tag":204,"props":1932,"children":1933},{},[1934],{"type":63,"value":1935},"# After — just change the import\n",{"type":49,"tag":204,"props":1937,"children":1938},{"class":206,"line":462},[1939],{"type":49,"tag":204,"props":1940,"children":1941},{},[1942],{"type":63,"value":1943},"from sentry_sdk.traces import trace\n",{"type":49,"tag":204,"props":1945,"children":1946},{"class":206,"line":470},[1947],{"type":49,"tag":204,"props":1948,"children":1949},{"emptyLinePlaceholder":43},[1950],{"type":63,"value":303},{"type":49,"tag":204,"props":1952,"children":1953},{"class":206,"line":479},[1954],{"type":49,"tag":204,"props":1955,"children":1956},{},[1957],{"type":63,"value":1905},{"type":49,"tag":204,"props":1959,"children":1960},{"class":206,"line":544},[1961],{"type":49,"tag":204,"props":1962,"children":1963},{},[1964],{"type":63,"value":1913},{"type":49,"tag":204,"props":1966,"children":1967},{"class":206,"line":552},[1968],{"type":49,"tag":204,"props":1969,"children":1970},{},[1971],{"type":63,"value":1273},{"type":49,"tag":54,"props":1973,"children":1974},{},[1975,1977,1982,1984,1989,1991,1996],{"type":63,"value":1976},"The new decorator also accepts optional ",{"type":49,"tag":88,"props":1978,"children":1980},{"className":1979},[],[1981],{"type":63,"value":1368},{"type":63,"value":1983}," (defaults to the function name), ",{"type":49,"tag":88,"props":1985,"children":1987},{"className":1986},[],[1988],{"type":63,"value":1379},{"type":63,"value":1990},", and ",{"type":49,"tag":88,"props":1992,"children":1994},{"className":1993},[],[1995],{"type":63,"value":1401},{"type":63,"value":1997}," arguments:",{"type":49,"tag":193,"props":1999,"children":2001},{"className":1054,"code":2000,"language":25,"meta":198,"style":198},"from sentry_sdk.traces import trace\n\n@trace(name=\"checkout\", attributes={\"flow.pipeline\": \"legacy\"})\ndef checkout():\n    ...\n",[2002],{"type":49,"tag":88,"props":2003,"children":2004},{"__ignoreMap":198},[2005,2012,2019,2027,2034],{"type":49,"tag":204,"props":2006,"children":2007},{"class":206,"line":207},[2008],{"type":49,"tag":204,"props":2009,"children":2010},{},[2011],{"type":63,"value":1943},{"type":49,"tag":204,"props":2013,"children":2014},{"class":206,"line":217},[2015],{"type":49,"tag":204,"props":2016,"children":2017},{"emptyLinePlaceholder":43},[2018],{"type":63,"value":303},{"type":49,"tag":204,"props":2020,"children":2021},{"class":206,"line":297},[2022],{"type":49,"tag":204,"props":2023,"children":2024},{},[2025],{"type":63,"value":2026},"@trace(name=\"checkout\", attributes={\"flow.pipeline\": \"legacy\"})\n",{"type":49,"tag":204,"props":2028,"children":2029},{"class":206,"line":306},[2030],{"type":49,"tag":204,"props":2031,"children":2032},{},[2033],{"type":63,"value":1913},{"type":49,"tag":204,"props":2035,"children":2036},{"class":206,"line":315},[2037],{"type":49,"tag":204,"props":2038,"children":2039},{},[2040],{"type":63,"value":1273},{"type":49,"tag":1202,"props":2042,"children":2044},{"id":2043},"get_current_span",[2045],{"type":49,"tag":88,"props":2046,"children":2048},{"className":2047},[],[2049],{"type":63,"value":2043},{"type":49,"tag":54,"props":2051,"children":2052},{},[2053,2054,2060,2061,2067],{"type":63,"value":1214},{"type":49,"tag":88,"props":2055,"children":2057},{"className":2056},[],[2058],{"type":63,"value":2059},"sentry_sdk.get_current_span()",{"type":63,"value":1222},{"type":49,"tag":88,"props":2062,"children":2064},{"className":2063},[],[2065],{"type":63,"value":2066},"sentry_sdk.traces.get_current_span()",{"type":63,"value":1051},{"type":49,"tag":193,"props":2069,"children":2071},{"className":1054,"code":2070,"language":25,"meta":198,"style":198},"# Before\nfrom sentry_sdk import get_current_span\n\nspan = get_current_span()\n\n# After\nfrom sentry_sdk.traces import get_current_span\n\nspan = get_current_span()\n",[2072],{"type":49,"tag":88,"props":2073,"children":2074},{"__ignoreMap":198},[2075,2082,2090,2097,2105,2112,2119,2127,2134],{"type":49,"tag":204,"props":2076,"children":2077},{"class":206,"line":207},[2078],{"type":49,"tag":204,"props":2079,"children":2080},{},[2081],{"type":63,"value":1082},{"type":49,"tag":204,"props":2083,"children":2084},{"class":206,"line":217},[2085],{"type":49,"tag":204,"props":2086,"children":2087},{},[2088],{"type":63,"value":2089},"from sentry_sdk import get_current_span\n",{"type":49,"tag":204,"props":2091,"children":2092},{"class":206,"line":297},[2093],{"type":49,"tag":204,"props":2094,"children":2095},{"emptyLinePlaceholder":43},[2096],{"type":63,"value":303},{"type":49,"tag":204,"props":2098,"children":2099},{"class":206,"line":306},[2100],{"type":49,"tag":204,"props":2101,"children":2102},{},[2103],{"type":63,"value":2104},"span = get_current_span()\n",{"type":49,"tag":204,"props":2106,"children":2107},{"class":206,"line":315},[2108],{"type":49,"tag":204,"props":2109,"children":2110},{"emptyLinePlaceholder":43},[2111],{"type":63,"value":303},{"type":49,"tag":204,"props":2113,"children":2114},{"class":206,"line":380},[2115],{"type":49,"tag":204,"props":2116,"children":2117},{},[2118],{"type":63,"value":1129},{"type":49,"tag":204,"props":2120,"children":2121},{"class":206,"line":388},[2122],{"type":49,"tag":204,"props":2123,"children":2124},{},[2125],{"type":63,"value":2126},"from sentry_sdk.traces import get_current_span\n",{"type":49,"tag":204,"props":2128,"children":2129},{"class":206,"line":397},[2130],{"type":49,"tag":204,"props":2131,"children":2132},{"emptyLinePlaceholder":43},[2133],{"type":63,"value":303},{"type":49,"tag":204,"props":2135,"children":2136},{"class":206,"line":462},[2137],{"type":49,"tag":204,"props":2138,"children":2139},{},[2140],{"type":63,"value":2104},{"type":49,"tag":1202,"props":2142,"children":2144},{"id":2143},"scopespan-and-scopetransaction",[2145,2151,2152],{"type":49,"tag":88,"props":2146,"children":2148},{"className":2147},[],[2149],{"type":63,"value":2150},"scope.span",{"type":63,"value":1186},{"type":49,"tag":88,"props":2153,"children":2155},{"className":2154},[],[2156],{"type":63,"value":2157},"scope.transaction",{"type":49,"tag":54,"props":2159,"children":2160},{},[2161],{"type":63,"value":2162},"If the code accesses the current span or transaction through the scope object, migrate to the new APIs:",{"type":49,"tag":193,"props":2164,"children":2166},{"className":1054,"code":2165,"language":25,"meta":198,"style":198},"import sentry_sdk\n\n# Before\nscope = sentry_sdk.get_current_scope()\ncurrent_span = scope.span\n\n# After\ncurrent_span = sentry_sdk.traces.get_current_span()\n",[2167],{"type":49,"tag":88,"props":2168,"children":2169},{"__ignoreMap":198},[2170,2177,2184,2191,2199,2207,2214,2221],{"type":49,"tag":204,"props":2171,"children":2172},{"class":206,"line":207},[2173],{"type":49,"tag":204,"props":2174,"children":2175},{},[2176],{"type":63,"value":1067},{"type":49,"tag":204,"props":2178,"children":2179},{"class":206,"line":217},[2180],{"type":49,"tag":204,"props":2181,"children":2182},{"emptyLinePlaceholder":43},[2183],{"type":63,"value":303},{"type":49,"tag":204,"props":2185,"children":2186},{"class":206,"line":297},[2187],{"type":49,"tag":204,"props":2188,"children":2189},{},[2190],{"type":63,"value":1082},{"type":49,"tag":204,"props":2192,"children":2193},{"class":206,"line":306},[2194],{"type":49,"tag":204,"props":2195,"children":2196},{},[2197],{"type":63,"value":2198},"scope = sentry_sdk.get_current_scope()\n",{"type":49,"tag":204,"props":2200,"children":2201},{"class":206,"line":315},[2202],{"type":49,"tag":204,"props":2203,"children":2204},{},[2205],{"type":63,"value":2206},"current_span = scope.span\n",{"type":49,"tag":204,"props":2208,"children":2209},{"class":206,"line":380},[2210],{"type":49,"tag":204,"props":2211,"children":2212},{"emptyLinePlaceholder":43},[2213],{"type":63,"value":303},{"type":49,"tag":204,"props":2215,"children":2216},{"class":206,"line":388},[2217],{"type":49,"tag":204,"props":2218,"children":2219},{},[2220],{"type":63,"value":1129},{"type":49,"tag":204,"props":2222,"children":2223},{"class":206,"line":397},[2224],{"type":49,"tag":204,"props":2225,"children":2226},{},[2227],{"type":63,"value":2228},"current_span = sentry_sdk.traces.get_current_span()\n",{"type":49,"tag":193,"props":2230,"children":2232},{"className":1054,"code":2231,"language":25,"meta":198,"style":198},"import sentry_sdk\n\n# Before\nscope = sentry_sdk.get_current_scope()\ntransaction = scope.transaction\n\n# After\nroot_span = sentry_sdk.traces.get_current_span()._segment\n",[2233],{"type":49,"tag":88,"props":2234,"children":2235},{"__ignoreMap":198},[2236,2243,2250,2257,2264,2272,2279,2286],{"type":49,"tag":204,"props":2237,"children":2238},{"class":206,"line":207},[2239],{"type":49,"tag":204,"props":2240,"children":2241},{},[2242],{"type":63,"value":1067},{"type":49,"tag":204,"props":2244,"children":2245},{"class":206,"line":217},[2246],{"type":49,"tag":204,"props":2247,"children":2248},{"emptyLinePlaceholder":43},[2249],{"type":63,"value":303},{"type":49,"tag":204,"props":2251,"children":2252},{"class":206,"line":297},[2253],{"type":49,"tag":204,"props":2254,"children":2255},{},[2256],{"type":63,"value":1082},{"type":49,"tag":204,"props":2258,"children":2259},{"class":206,"line":306},[2260],{"type":49,"tag":204,"props":2261,"children":2262},{},[2263],{"type":63,"value":2198},{"type":49,"tag":204,"props":2265,"children":2266},{"class":206,"line":315},[2267],{"type":49,"tag":204,"props":2268,"children":2269},{},[2270],{"type":63,"value":2271},"transaction = scope.transaction\n",{"type":49,"tag":204,"props":2273,"children":2274},{"class":206,"line":380},[2275],{"type":49,"tag":204,"props":2276,"children":2277},{"emptyLinePlaceholder":43},[2278],{"type":63,"value":303},{"type":49,"tag":204,"props":2280,"children":2281},{"class":206,"line":388},[2282],{"type":49,"tag":204,"props":2283,"children":2284},{},[2285],{"type":63,"value":1129},{"type":49,"tag":204,"props":2287,"children":2288},{"class":206,"line":397},[2289],{"type":49,"tag":204,"props":2290,"children":2291},{},[2292],{"type":63,"value":2293},"root_span = sentry_sdk.traces.get_current_span()._segment\n",{"type":49,"tag":54,"props":2295,"children":2296},{},[2297,2303],{"type":49,"tag":88,"props":2298,"children":2300},{"className":2299},[],[2301],{"type":63,"value":2302},"_segment",{"type":63,"value":2304}," returns the root span of the current trace (the equivalent of what used to be the transaction). It is a private API — prefer restructuring the code to avoid needing the root span where possible.",{"type":49,"tag":1202,"props":2306,"children":2308},{"id":2307},"spancontaining_transaction",[2309],{"type":49,"tag":88,"props":2310,"children":2312},{"className":2311},[],[2313],{"type":63,"value":2314},"span.containing_transaction",{"type":49,"tag":54,"props":2316,"children":2317},{},[2318,2323,2325,2331],{"type":49,"tag":88,"props":2319,"children":2321},{"className":2320},[],[2322],{"type":63,"value":2314},{"type":63,"value":2324}," no longer exists. Use ",{"type":49,"tag":88,"props":2326,"children":2328},{"className":2327},[],[2329],{"type":63,"value":2330},"span._segment",{"type":63,"value":2332}," to get the root span:",{"type":49,"tag":193,"props":2334,"children":2336},{"className":1054,"code":2335,"language":25,"meta":198,"style":198},"# Before\ntransaction = span.containing_transaction\n\n# After\nroot_span = span._segment\n",[2337],{"type":49,"tag":88,"props":2338,"children":2339},{"__ignoreMap":198},[2340,2347,2355,2362,2369],{"type":49,"tag":204,"props":2341,"children":2342},{"class":206,"line":207},[2343],{"type":49,"tag":204,"props":2344,"children":2345},{},[2346],{"type":63,"value":1082},{"type":49,"tag":204,"props":2348,"children":2349},{"class":206,"line":217},[2350],{"type":49,"tag":204,"props":2351,"children":2352},{},[2353],{"type":63,"value":2354},"transaction = span.containing_transaction\n",{"type":49,"tag":204,"props":2356,"children":2357},{"class":206,"line":297},[2358],{"type":49,"tag":204,"props":2359,"children":2360},{"emptyLinePlaceholder":43},[2361],{"type":63,"value":303},{"type":49,"tag":204,"props":2363,"children":2364},{"class":206,"line":306},[2365],{"type":49,"tag":204,"props":2366,"children":2367},{},[2368],{"type":63,"value":1129},{"type":49,"tag":204,"props":2370,"children":2371},{"class":206,"line":315},[2372],{"type":49,"tag":204,"props":2373,"children":2374},{},[2375],{"type":63,"value":2376},"root_span = span._segment\n",{"type":49,"tag":1202,"props":2378,"children":2380},{"id":2379},"span-and-transaction-classes",[2381,2387,2388,2394],{"type":49,"tag":88,"props":2382,"children":2384},{"className":2383},[],[2385],{"type":63,"value":2386},"Span",{"type":63,"value":1186},{"type":49,"tag":88,"props":2389,"children":2391},{"className":2390},[],[2392],{"type":63,"value":2393},"Transaction",{"type":63,"value":2395}," Classes",{"type":49,"tag":54,"props":2397,"children":2398},{},[2399,2401,2406,2407,2412,2414,2420],{"type":63,"value":2400},"If the code imports ",{"type":49,"tag":88,"props":2402,"children":2404},{"className":2403},[],[2405],{"type":63,"value":2386},{"type":63,"value":1023},{"type":49,"tag":88,"props":2408,"children":2410},{"className":2409},[],[2411],{"type":63,"value":2393},{"type":63,"value":2413}," directly (e.g. for type annotations), replace both with ",{"type":49,"tag":88,"props":2415,"children":2417},{"className":2416},[],[2418],{"type":63,"value":2419},"StreamedSpan",{"type":63,"value":1051},{"type":49,"tag":193,"props":2422,"children":2424},{"className":1054,"code":2423,"language":25,"meta":198,"style":198},"# Before\nfrom sentry_sdk.tracing import Span, Transaction\n\ndef process(span: Span) -> None:\n    ...\n\n# After\nfrom sentry_sdk.traces import StreamedSpan\n\ndef process(span: StreamedSpan) -> None:\n    ...\n",[2425],{"type":49,"tag":88,"props":2426,"children":2427},{"__ignoreMap":198},[2428,2435,2443,2450,2458,2465,2472,2479,2487,2494,2502],{"type":49,"tag":204,"props":2429,"children":2430},{"class":206,"line":207},[2431],{"type":49,"tag":204,"props":2432,"children":2433},{},[2434],{"type":63,"value":1082},{"type":49,"tag":204,"props":2436,"children":2437},{"class":206,"line":217},[2438],{"type":49,"tag":204,"props":2439,"children":2440},{},[2441],{"type":63,"value":2442},"from sentry_sdk.tracing import Span, Transaction\n",{"type":49,"tag":204,"props":2444,"children":2445},{"class":206,"line":297},[2446],{"type":49,"tag":204,"props":2447,"children":2448},{"emptyLinePlaceholder":43},[2449],{"type":63,"value":303},{"type":49,"tag":204,"props":2451,"children":2452},{"class":206,"line":306},[2453],{"type":49,"tag":204,"props":2454,"children":2455},{},[2456],{"type":63,"value":2457},"def process(span: Span) -> None:\n",{"type":49,"tag":204,"props":2459,"children":2460},{"class":206,"line":315},[2461],{"type":49,"tag":204,"props":2462,"children":2463},{},[2464],{"type":63,"value":1273},{"type":49,"tag":204,"props":2466,"children":2467},{"class":206,"line":380},[2468],{"type":49,"tag":204,"props":2469,"children":2470},{"emptyLinePlaceholder":43},[2471],{"type":63,"value":303},{"type":49,"tag":204,"props":2473,"children":2474},{"class":206,"line":388},[2475],{"type":49,"tag":204,"props":2476,"children":2477},{},[2478],{"type":63,"value":1129},{"type":49,"tag":204,"props":2480,"children":2481},{"class":206,"line":397},[2482],{"type":49,"tag":204,"props":2483,"children":2484},{},[2485],{"type":63,"value":2486},"from sentry_sdk.traces import StreamedSpan\n",{"type":49,"tag":204,"props":2488,"children":2489},{"class":206,"line":462},[2490],{"type":49,"tag":204,"props":2491,"children":2492},{"emptyLinePlaceholder":43},[2493],{"type":63,"value":303},{"type":49,"tag":204,"props":2495,"children":2496},{"class":206,"line":470},[2497],{"type":49,"tag":204,"props":2498,"children":2499},{},[2500],{"type":63,"value":2501},"def process(span: StreamedSpan) -> None:\n",{"type":49,"tag":204,"props":2503,"children":2504},{"class":206,"line":479},[2505],{"type":49,"tag":204,"props":2506,"children":2507},{},[2508],{"type":63,"value":1273},{"type":49,"tag":1202,"props":2510,"children":2511},{"id":907},[2512],{"type":49,"tag":88,"props":2513,"children":2515},{"className":2514},[],[2516],{"type":63,"value":907},{"type":49,"tag":54,"props":2518,"children":2519},{},[2520,2526],{"type":49,"tag":88,"props":2521,"children":2523},{"className":2522},[],[2524],{"type":63,"value":2525},"span.get_trace_context()",{"type":63,"value":2527}," no longer exists on streaming spans. Migrate based on what you actually need from the trace context:",{"type":49,"tag":54,"props":2529,"children":2530},{},[2531,2533,2539,2540,2546,2548,2554],{"type":63,"value":2532},"If the code only reads specific fields (like ",{"type":49,"tag":88,"props":2534,"children":2536},{"className":2535},[],[2537],{"type":63,"value":2538},"trace_id",{"type":63,"value":159},{"type":49,"tag":88,"props":2541,"children":2543},{"className":2542},[],[2544],{"type":63,"value":2545},"span_id",{"type":63,"value":2547},", or ",{"type":49,"tag":88,"props":2549,"children":2551},{"className":2550},[],[2552],{"type":63,"value":2553},"parent_span_id",{"type":63,"value":2555},"), access them directly as span properties:",{"type":49,"tag":193,"props":2557,"children":2559},{"className":1054,"code":2558,"language":25,"meta":198,"style":198},"# Before\nctx = span.get_trace_context()\ntrace_id = ctx[\"trace_id\"]\nspan_id = ctx[\"span_id\"]\n\n# After\ntrace_id = span.trace_id\nspan_id = span.span_id\n",[2560],{"type":49,"tag":88,"props":2561,"children":2562},{"__ignoreMap":198},[2563,2570,2578,2586,2594,2601,2608,2616],{"type":49,"tag":204,"props":2564,"children":2565},{"class":206,"line":207},[2566],{"type":49,"tag":204,"props":2567,"children":2568},{},[2569],{"type":63,"value":1082},{"type":49,"tag":204,"props":2571,"children":2572},{"class":206,"line":217},[2573],{"type":49,"tag":204,"props":2574,"children":2575},{},[2576],{"type":63,"value":2577},"ctx = span.get_trace_context()\n",{"type":49,"tag":204,"props":2579,"children":2580},{"class":206,"line":297},[2581],{"type":49,"tag":204,"props":2582,"children":2583},{},[2584],{"type":63,"value":2585},"trace_id = ctx[\"trace_id\"]\n",{"type":49,"tag":204,"props":2587,"children":2588},{"class":206,"line":306},[2589],{"type":49,"tag":204,"props":2590,"children":2591},{},[2592],{"type":63,"value":2593},"span_id = ctx[\"span_id\"]\n",{"type":49,"tag":204,"props":2595,"children":2596},{"class":206,"line":315},[2597],{"type":49,"tag":204,"props":2598,"children":2599},{"emptyLinePlaceholder":43},[2600],{"type":63,"value":303},{"type":49,"tag":204,"props":2602,"children":2603},{"class":206,"line":380},[2604],{"type":49,"tag":204,"props":2605,"children":2606},{},[2607],{"type":63,"value":1129},{"type":49,"tag":204,"props":2609,"children":2610},{"class":206,"line":388},[2611],{"type":49,"tag":204,"props":2612,"children":2613},{},[2614],{"type":63,"value":2615},"trace_id = span.trace_id\n",{"type":49,"tag":204,"props":2617,"children":2618},{"class":206,"line":397},[2619],{"type":49,"tag":204,"props":2620,"children":2621},{},[2622],{"type":63,"value":2623},"span_id = span.span_id\n",{"type":49,"tag":54,"props":2625,"children":2626},{},[2627,2629,2635],{"type":63,"value":2628},"If the code genuinely needs the full trace context dict (e.g. to pass it to an external system or serialize it), use the private method ",{"type":49,"tag":88,"props":2630,"children":2632},{"className":2631},[],[2633],{"type":63,"value":2634},"span._get_trace_context()",{"type":63,"value":1051},{"type":49,"tag":193,"props":2637,"children":2639},{"className":1054,"code":2638,"language":25,"meta":198,"style":198},"# Before\nctx = span.get_trace_context()\n\n# After\nctx = span._get_trace_context()\n",[2640],{"type":49,"tag":88,"props":2641,"children":2642},{"__ignoreMap":198},[2643,2650,2657,2664,2671],{"type":49,"tag":204,"props":2644,"children":2645},{"class":206,"line":207},[2646],{"type":49,"tag":204,"props":2647,"children":2648},{},[2649],{"type":63,"value":1082},{"type":49,"tag":204,"props":2651,"children":2652},{"class":206,"line":217},[2653],{"type":49,"tag":204,"props":2654,"children":2655},{},[2656],{"type":63,"value":2577},{"type":49,"tag":204,"props":2658,"children":2659},{"class":206,"line":297},[2660],{"type":49,"tag":204,"props":2661,"children":2662},{"emptyLinePlaceholder":43},[2663],{"type":63,"value":303},{"type":49,"tag":204,"props":2665,"children":2666},{"class":206,"line":306},[2667],{"type":49,"tag":204,"props":2668,"children":2669},{},[2670],{"type":63,"value":1129},{"type":49,"tag":204,"props":2672,"children":2673},{"class":206,"line":315},[2674],{"type":49,"tag":204,"props":2675,"children":2676},{},[2677],{"type":63,"value":2678},"ctx = span._get_trace_context()\n",{"type":49,"tag":54,"props":2680,"children":2681},{},[2682,2684,2690],{"type":63,"value":2683},"Prefer the direct property access where possible — ",{"type":49,"tag":88,"props":2685,"children":2687},{"className":2686},[],[2688],{"type":63,"value":2689},"_get_trace_context()",{"type":63,"value":2691}," is a private API and may change.",{"type":49,"tag":186,"props":2693,"children":2695},{"id":2694},"migrate-span-data",[2696],{"type":63,"value":2697},"Migrate Span Data",{"type":49,"tag":54,"props":2699,"children":2700},{},[2701,2703,2709,2710,2716,2717,2723,2724,2730,2732,2738],{"type":63,"value":2702},"In span streaming mode, spans have no contexts, data, or tags. Everything is a span attribute. Attribute keys are strings; values must be ",{"type":49,"tag":88,"props":2704,"children":2706},{"className":2705},[],[2707],{"type":63,"value":2708},"int",{"type":63,"value":159},{"type":49,"tag":88,"props":2711,"children":2713},{"className":2712},[],[2714],{"type":63,"value":2715},"bool",{"type":63,"value":159},{"type":49,"tag":88,"props":2718,"children":2720},{"className":2719},[],[2721],{"type":63,"value":2722},"str",{"type":63,"value":159},{"type":49,"tag":88,"props":2725,"children":2727},{"className":2726},[],[2728],{"type":63,"value":2729},"float",{"type":63,"value":2731},", or an array of these types. ",{"type":49,"tag":88,"props":2733,"children":2735},{"className":2734},[],[2736],{"type":63,"value":2737},"None",{"type":63,"value":2739}," is not supported.",{"type":49,"tag":54,"props":2741,"children":2742},{},[2743,2748,2750,2755,2757,2763,2765,2771],{"type":49,"tag":994,"props":2744,"children":2745},{},[2746],{"type":63,"value":2747},"Important:",{"type":63,"value":2749}," Unlike the old ",{"type":49,"tag":88,"props":2751,"children":2753},{"className":2752},[],[2754],{"type":63,"value":981},{"type":63,"value":2756}," \u002F ",{"type":49,"tag":88,"props":2758,"children":2760},{"className":2759},[],[2761],{"type":63,"value":2762},"set_tag",{"type":63,"value":2764}," APIs, ",{"type":49,"tag":88,"props":2766,"children":2768},{"className":2767},[],[2769],{"type":63,"value":2770},"set_attribute",{"type":63,"value":2772}," only supports primitive types. Non-primitive values must be either stringified or broken down into multiple primitive-typed attributes:",{"type":49,"tag":193,"props":2774,"children":2776},{"className":1054,"code":2775,"language":25,"meta":198,"style":198},"# Before — set_data accepted any type\nspan.set_data(\"request\", {\"method\": \"POST\", \"path\": \"\u002Fapi\u002Fcheckout\"})\nspan.set_data(\"response_headers\", response.headers)\n\n# After — flatten dicts into separate attributes\nspan.set_attributes({\n    \"request.method\": \"POST\",\n    \"request.path\": \"\u002Fapi\u002Fcheckout\",\n})\n\n# After — stringify objects that can't be flattened\nspan.set_attribute(\"response_headers\", str(response.headers))\n",[2777],{"type":49,"tag":88,"props":2778,"children":2779},{"__ignoreMap":198},[2780,2788,2796,2804,2811,2819,2827,2835,2843,2851,2858,2866],{"type":49,"tag":204,"props":2781,"children":2782},{"class":206,"line":207},[2783],{"type":49,"tag":204,"props":2784,"children":2785},{},[2786],{"type":63,"value":2787},"# Before — set_data accepted any type\n",{"type":49,"tag":204,"props":2789,"children":2790},{"class":206,"line":217},[2791],{"type":49,"tag":204,"props":2792,"children":2793},{},[2794],{"type":63,"value":2795},"span.set_data(\"request\", {\"method\": \"POST\", \"path\": \"\u002Fapi\u002Fcheckout\"})\n",{"type":49,"tag":204,"props":2797,"children":2798},{"class":206,"line":297},[2799],{"type":49,"tag":204,"props":2800,"children":2801},{},[2802],{"type":63,"value":2803},"span.set_data(\"response_headers\", response.headers)\n",{"type":49,"tag":204,"props":2805,"children":2806},{"class":206,"line":306},[2807],{"type":49,"tag":204,"props":2808,"children":2809},{"emptyLinePlaceholder":43},[2810],{"type":63,"value":303},{"type":49,"tag":204,"props":2812,"children":2813},{"class":206,"line":315},[2814],{"type":49,"tag":204,"props":2815,"children":2816},{},[2817],{"type":63,"value":2818},"# After — flatten dicts into separate attributes\n",{"type":49,"tag":204,"props":2820,"children":2821},{"class":206,"line":380},[2822],{"type":49,"tag":204,"props":2823,"children":2824},{},[2825],{"type":63,"value":2826},"span.set_attributes({\n",{"type":49,"tag":204,"props":2828,"children":2829},{"class":206,"line":388},[2830],{"type":49,"tag":204,"props":2831,"children":2832},{},[2833],{"type":63,"value":2834},"    \"request.method\": \"POST\",\n",{"type":49,"tag":204,"props":2836,"children":2837},{"class":206,"line":397},[2838],{"type":49,"tag":204,"props":2839,"children":2840},{},[2841],{"type":63,"value":2842},"    \"request.path\": \"\u002Fapi\u002Fcheckout\",\n",{"type":49,"tag":204,"props":2844,"children":2845},{"class":206,"line":462},[2846],{"type":49,"tag":204,"props":2847,"children":2848},{},[2849],{"type":63,"value":2850},"})\n",{"type":49,"tag":204,"props":2852,"children":2853},{"class":206,"line":470},[2854],{"type":49,"tag":204,"props":2855,"children":2856},{"emptyLinePlaceholder":43},[2857],{"type":63,"value":303},{"type":49,"tag":204,"props":2859,"children":2860},{"class":206,"line":479},[2861],{"type":49,"tag":204,"props":2862,"children":2863},{},[2864],{"type":63,"value":2865},"# After — stringify objects that can't be flattened\n",{"type":49,"tag":204,"props":2867,"children":2868},{"class":206,"line":544},[2869],{"type":49,"tag":204,"props":2870,"children":2871},{},[2872],{"type":63,"value":2873},"span.set_attribute(\"response_headers\", str(response.headers))\n",{"type":49,"tag":1202,"props":2875,"children":2877},{"id":2876},"replace-set_data",[2878,2879],{"type":63,"value":1214},{"type":49,"tag":88,"props":2880,"children":2882},{"className":2881},[],[2883],{"type":63,"value":981},{"type":49,"tag":193,"props":2885,"children":2887},{"className":1054,"code":2886,"language":25,"meta":198,"style":198},"# Before\nspan.set_data(\"flow.step\", \"submit_payment\")\n\n# After\nspan.set_attribute(\"flow.step\", \"submit_payment\")\n",[2888],{"type":49,"tag":88,"props":2889,"children":2890},{"__ignoreMap":198},[2891,2898,2906,2913,2920],{"type":49,"tag":204,"props":2892,"children":2893},{"class":206,"line":207},[2894],{"type":49,"tag":204,"props":2895,"children":2896},{},[2897],{"type":63,"value":1082},{"type":49,"tag":204,"props":2899,"children":2900},{"class":206,"line":217},[2901],{"type":49,"tag":204,"props":2902,"children":2903},{},[2904],{"type":63,"value":2905},"span.set_data(\"flow.step\", \"submit_payment\")\n",{"type":49,"tag":204,"props":2907,"children":2908},{"class":206,"line":297},[2909],{"type":49,"tag":204,"props":2910,"children":2911},{"emptyLinePlaceholder":43},[2912],{"type":63,"value":303},{"type":49,"tag":204,"props":2914,"children":2915},{"class":206,"line":306},[2916],{"type":49,"tag":204,"props":2917,"children":2918},{},[2919],{"type":63,"value":1129},{"type":49,"tag":204,"props":2921,"children":2922},{"class":206,"line":315},[2923],{"type":49,"tag":204,"props":2924,"children":2925},{},[2926],{"type":63,"value":2927},"span.set_attribute(\"flow.step\", \"submit_payment\")\n",{"type":49,"tag":1202,"props":2929,"children":2931},{"id":2930},"replace-set_tag",[2932,2933],{"type":63,"value":1214},{"type":49,"tag":88,"props":2934,"children":2936},{"className":2935},[],[2937],{"type":63,"value":2762},{"type":49,"tag":193,"props":2939,"children":2941},{"className":1054,"code":2940,"language":25,"meta":198,"style":198},"# Before\nspan.set_tag(\"http.status_code\", 201)\n\n# After\nspan.set_attribute(\"http.response.status_code\", 201)\n",[2942],{"type":49,"tag":88,"props":2943,"children":2944},{"__ignoreMap":198},[2945,2952,2960,2967,2974],{"type":49,"tag":204,"props":2946,"children":2947},{"class":206,"line":207},[2948],{"type":49,"tag":204,"props":2949,"children":2950},{},[2951],{"type":63,"value":1082},{"type":49,"tag":204,"props":2953,"children":2954},{"class":206,"line":217},[2955],{"type":49,"tag":204,"props":2956,"children":2957},{},[2958],{"type":63,"value":2959},"span.set_tag(\"http.status_code\", 201)\n",{"type":49,"tag":204,"props":2961,"children":2962},{"class":206,"line":297},[2963],{"type":49,"tag":204,"props":2964,"children":2965},{"emptyLinePlaceholder":43},[2966],{"type":63,"value":303},{"type":49,"tag":204,"props":2968,"children":2969},{"class":206,"line":306},[2970],{"type":49,"tag":204,"props":2971,"children":2972},{},[2973],{"type":63,"value":1129},{"type":49,"tag":204,"props":2975,"children":2976},{"class":206,"line":315},[2977],{"type":49,"tag":204,"props":2978,"children":2979},{},[2980],{"type":63,"value":2981},"span.set_attribute(\"http.response.status_code\", 201)\n",{"type":49,"tag":54,"props":2983,"children":2984},{},[2985,2987,2992,2993,2998,3000,3006],{"type":63,"value":2986},"When migrating multiple consecutive ",{"type":49,"tag":88,"props":2988,"children":2990},{"className":2989},[],[2991],{"type":63,"value":981},{"type":63,"value":2756},{"type":49,"tag":88,"props":2994,"children":2996},{"className":2995},[],[2997],{"type":63,"value":2762},{"type":63,"value":2999}," calls, combine them into a single ",{"type":49,"tag":88,"props":3001,"children":3003},{"className":3002},[],[3004],{"type":63,"value":3005},"set_attributes()",{"type":63,"value":3007}," call:",{"type":49,"tag":193,"props":3009,"children":3011},{"className":1054,"code":3010,"language":25,"meta":198,"style":198},"# Before\nspan.set_data(\"flow.step\", \"submit_payment\")\nspan.set_data(\"flow.version\", \"0.35\")\nspan.set_tag(\"http.status_code\", 201)\n\n# After\nspan.set_attributes({\n    \"flow.step\": \"submit_payment\",\n    \"flow.version\": \"0.35\",\n    \"http.response.status_code\": 201,\n})\n",[3012],{"type":49,"tag":88,"props":3013,"children":3014},{"__ignoreMap":198},[3015,3022,3029,3037,3044,3051,3058,3065,3073,3081,3089],{"type":49,"tag":204,"props":3016,"children":3017},{"class":206,"line":207},[3018],{"type":49,"tag":204,"props":3019,"children":3020},{},[3021],{"type":63,"value":1082},{"type":49,"tag":204,"props":3023,"children":3024},{"class":206,"line":217},[3025],{"type":49,"tag":204,"props":3026,"children":3027},{},[3028],{"type":63,"value":2905},{"type":49,"tag":204,"props":3030,"children":3031},{"class":206,"line":297},[3032],{"type":49,"tag":204,"props":3033,"children":3034},{},[3035],{"type":63,"value":3036},"span.set_data(\"flow.version\", \"0.35\")\n",{"type":49,"tag":204,"props":3038,"children":3039},{"class":206,"line":306},[3040],{"type":49,"tag":204,"props":3041,"children":3042},{},[3043],{"type":63,"value":2959},{"type":49,"tag":204,"props":3045,"children":3046},{"class":206,"line":315},[3047],{"type":49,"tag":204,"props":3048,"children":3049},{"emptyLinePlaceholder":43},[3050],{"type":63,"value":303},{"type":49,"tag":204,"props":3052,"children":3053},{"class":206,"line":380},[3054],{"type":49,"tag":204,"props":3055,"children":3056},{},[3057],{"type":63,"value":1129},{"type":49,"tag":204,"props":3059,"children":3060},{"class":206,"line":388},[3061],{"type":49,"tag":204,"props":3062,"children":3063},{},[3064],{"type":63,"value":2826},{"type":49,"tag":204,"props":3066,"children":3067},{"class":206,"line":397},[3068],{"type":49,"tag":204,"props":3069,"children":3070},{},[3071],{"type":63,"value":3072},"    \"flow.step\": \"submit_payment\",\n",{"type":49,"tag":204,"props":3074,"children":3075},{"class":206,"line":462},[3076],{"type":49,"tag":204,"props":3077,"children":3078},{},[3079],{"type":63,"value":3080},"    \"flow.version\": \"0.35\",\n",{"type":49,"tag":204,"props":3082,"children":3083},{"class":206,"line":470},[3084],{"type":49,"tag":204,"props":3085,"children":3086},{},[3087],{"type":63,"value":3088},"    \"http.response.status_code\": 201,\n",{"type":49,"tag":204,"props":3090,"children":3091},{"class":206,"line":479},[3092],{"type":49,"tag":204,"props":3093,"children":3094},{},[3095],{"type":63,"value":2850},{"type":49,"tag":1202,"props":3097,"children":3099},{"id":3098},"replace-set_context",[3100,3101],{"type":63,"value":1214},{"type":49,"tag":88,"props":3102,"children":3104},{"className":3103},[],[3105],{"type":63,"value":3106},"set_context",{"type":49,"tag":54,"props":3108,"children":3109},{},[3110],{"type":63,"value":3111},"Dictionaries are not supported as attribute values. Flatten them into separate attributes:",{"type":49,"tag":193,"props":3113,"children":3115},{"className":1054,"code":3114,"language":25,"meta":198,"style":198},"# Before\nspan.set_context(\"flow\", {\"id\": \"123456789\", \"pipeline\": \"legacy\"})\n\n# After\nspan.set_attributes({\"flow.id\": \"123456789\", \"flow.pipeline\": \"legacy\"})\n",[3116],{"type":49,"tag":88,"props":3117,"children":3118},{"__ignoreMap":198},[3119,3126,3134,3141,3148],{"type":49,"tag":204,"props":3120,"children":3121},{"class":206,"line":207},[3122],{"type":49,"tag":204,"props":3123,"children":3124},{},[3125],{"type":63,"value":1082},{"type":49,"tag":204,"props":3127,"children":3128},{"class":206,"line":217},[3129],{"type":49,"tag":204,"props":3130,"children":3131},{},[3132],{"type":63,"value":3133},"span.set_context(\"flow\", {\"id\": \"123456789\", \"pipeline\": \"legacy\"})\n",{"type":49,"tag":204,"props":3135,"children":3136},{"class":206,"line":297},[3137],{"type":49,"tag":204,"props":3138,"children":3139},{"emptyLinePlaceholder":43},[3140],{"type":63,"value":303},{"type":49,"tag":204,"props":3142,"children":3143},{"class":206,"line":306},[3144],{"type":49,"tag":204,"props":3145,"children":3146},{},[3147],{"type":63,"value":1129},{"type":49,"tag":204,"props":3149,"children":3150},{"class":206,"line":315},[3151],{"type":49,"tag":204,"props":3152,"children":3153},{},[3154],{"type":63,"value":3155},"span.set_attributes({\"flow.id\": \"123456789\", \"flow.pipeline\": \"legacy\"})\n",{"type":49,"tag":1202,"props":3157,"children":3159},{"id":3158},"scope-level-tags",[3160],{"type":63,"value":3161},"Scope-Level Tags",{"type":49,"tag":54,"props":3163,"children":3164},{},[3165,3167,3173,3175,3181],{"type":63,"value":3166},"Tags set on the scope with ",{"type":49,"tag":88,"props":3168,"children":3170},{"className":3169},[],[3171],{"type":63,"value":3172},"sentry_sdk.set_tag()",{"type":63,"value":3174}," are not applied to streaming spans. Use ",{"type":49,"tag":88,"props":3176,"children":3178},{"className":3177},[],[3179],{"type":63,"value":3180},"sentry_sdk.set_attribute()",{"type":63,"value":3182}," to apply data to spans:",{"type":49,"tag":193,"props":3184,"children":3186},{"className":1054,"code":3185,"language":25,"meta":198,"style":198},"import sentry_sdk\n\nsentry_sdk.set_tag(\"region\", \"Europe\")       # applied to errors and other tag-supporting telemetry\nsentry_sdk.set_attribute(\"region\", \"Europe\")  # applied to spans, logs, metrics\n",[3187],{"type":49,"tag":88,"props":3188,"children":3189},{"__ignoreMap":198},[3190,3197,3204,3212],{"type":49,"tag":204,"props":3191,"children":3192},{"class":206,"line":207},[3193],{"type":49,"tag":204,"props":3194,"children":3195},{},[3196],{"type":63,"value":1067},{"type":49,"tag":204,"props":3198,"children":3199},{"class":206,"line":217},[3200],{"type":49,"tag":204,"props":3201,"children":3202},{"emptyLinePlaceholder":43},[3203],{"type":63,"value":303},{"type":49,"tag":204,"props":3205,"children":3206},{"class":206,"line":297},[3207],{"type":49,"tag":204,"props":3208,"children":3209},{},[3210],{"type":63,"value":3211},"sentry_sdk.set_tag(\"region\", \"Europe\")       # applied to errors and other tag-supporting telemetry\n",{"type":49,"tag":204,"props":3213,"children":3214},{"class":206,"line":306},[3215],{"type":49,"tag":204,"props":3216,"children":3217},{},[3218],{"type":63,"value":3219},"sentry_sdk.set_attribute(\"region\", \"Europe\")  # applied to spans, logs, metrics\n",{"type":49,"tag":1202,"props":3221,"children":3223},{"id":3222},"bulk-operations",[3224],{"type":63,"value":3225},"Bulk Operations",{"type":49,"tag":193,"props":3227,"children":3229},{"className":1054,"code":3228,"language":25,"meta":198,"style":198},"with sentry_sdk.traces.start_span(name=\"flow.checkout\") as span:\n    span.set_attribute(\"flow.version\", \"0.35\")\n    span.set_attributes({\"flow.conversion\": 1.0, \"flow.use_new_pipeline\": True})\n    span.remove_attribute(\"flow.conversion\")\n",[3230],{"type":49,"tag":88,"props":3231,"children":3232},{"__ignoreMap":198},[3233,3240,3248,3256],{"type":49,"tag":204,"props":3234,"children":3235},{"class":206,"line":207},[3236],{"type":49,"tag":204,"props":3237,"children":3238},{},[3239],{"type":63,"value":1295},{"type":49,"tag":204,"props":3241,"children":3242},{"class":206,"line":217},[3243],{"type":49,"tag":204,"props":3244,"children":3245},{},[3246],{"type":63,"value":3247},"    span.set_attribute(\"flow.version\", \"0.35\")\n",{"type":49,"tag":204,"props":3249,"children":3250},{"class":206,"line":297},[3251],{"type":49,"tag":204,"props":3252,"children":3253},{},[3254],{"type":63,"value":3255},"    span.set_attributes({\"flow.conversion\": 1.0, \"flow.use_new_pipeline\": True})\n",{"type":49,"tag":204,"props":3257,"children":3258},{"class":206,"line":306},[3259],{"type":49,"tag":204,"props":3260,"children":3261},{},[3262],{"type":63,"value":3263},"    span.remove_attribute(\"flow.conversion\")\n",{"type":49,"tag":1202,"props":3265,"children":3267},{"id":3266},"span-status",[3268],{"type":63,"value":3269},"Span Status",{"type":49,"tag":54,"props":3271,"children":3272},{},[3273,3275,3281,3283,3289],{"type":63,"value":3274},"Status can only be ",{"type":49,"tag":88,"props":3276,"children":3278},{"className":3277},[],[3279],{"type":63,"value":3280},"ok",{"type":63,"value":3282}," (default) or ",{"type":49,"tag":88,"props":3284,"children":3286},{"className":3285},[],[3287],{"type":63,"value":3288},"error",{"type":63,"value":1051},{"type":49,"tag":193,"props":3291,"children":3293},{"className":1054,"code":3292,"language":25,"meta":198,"style":198},"from sentry_sdk.traces import start_span\n\nwith start_span(name=\"process\") as span:\n    try:\n        ...\n    except Exception:\n        span.status = \"error\"\n",[3294],{"type":49,"tag":88,"props":3295,"children":3296},{"__ignoreMap":198},[3297,3304,3311,3319,3327,3334,3342],{"type":49,"tag":204,"props":3298,"children":3299},{"class":206,"line":207},[3300],{"type":49,"tag":204,"props":3301,"children":3302},{},[3303],{"type":63,"value":1351},{"type":49,"tag":204,"props":3305,"children":3306},{"class":206,"line":217},[3307],{"type":49,"tag":204,"props":3308,"children":3309},{"emptyLinePlaceholder":43},[3310],{"type":63,"value":303},{"type":49,"tag":204,"props":3312,"children":3313},{"class":206,"line":297},[3314],{"type":49,"tag":204,"props":3315,"children":3316},{},[3317],{"type":63,"value":3318},"with start_span(name=\"process\") as span:\n",{"type":49,"tag":204,"props":3320,"children":3321},{"class":206,"line":306},[3322],{"type":49,"tag":204,"props":3323,"children":3324},{},[3325],{"type":63,"value":3326},"    try:\n",{"type":49,"tag":204,"props":3328,"children":3329},{"class":206,"line":315},[3330],{"type":49,"tag":204,"props":3331,"children":3332},{},[3333],{"type":63,"value":1719},{"type":49,"tag":204,"props":3335,"children":3336},{"class":206,"line":380},[3337],{"type":49,"tag":204,"props":3338,"children":3339},{},[3340],{"type":63,"value":3341},"    except Exception:\n",{"type":49,"tag":204,"props":3343,"children":3344},{"class":206,"line":388},[3345],{"type":49,"tag":204,"props":3346,"children":3347},{},[3348],{"type":63,"value":3349},"        span.status = \"error\"\n",{"type":49,"tag":186,"props":3351,"children":3353},{"id":3352},"migrate-trace-propagation",[3354],{"type":63,"value":3355},"Migrate Trace Propagation",{"type":49,"tag":54,"props":3357,"children":3358},{},[3359,3365,3367,3373],{"type":49,"tag":88,"props":3360,"children":3362},{"className":3361},[],[3363],{"type":63,"value":3364},"sentry_sdk.traces.continue_trace()",{"type":63,"value":3366}," replaces the legacy ",{"type":49,"tag":88,"props":3368,"children":3370},{"className":3369},[],[3371],{"type":63,"value":3372},"sentry_sdk.continue_trace()",{"type":63,"value":3374},". It is no longer a context manager — it sets the propagation context, and the next span picks it up automatically:",{"type":49,"tag":193,"props":3376,"children":3378},{"className":1054,"code":3377,"language":25,"meta":198,"style":198},"import sentry_sdk\n\nheaders = {\n    \"sentry-trace\": \"4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1\",\n    \"baggage\": \"sentry-trace_id=...\",\n}\n\n# Before\nwith sentry_sdk.continue_trace(headers) as transaction:\n    ...\n\n# After\nsentry_sdk.traces.continue_trace(headers)\nwith sentry_sdk.traces.start_span(name=\"handle request\"):\n    ...\n",[3379],{"type":49,"tag":88,"props":3380,"children":3381},{"__ignoreMap":198},[3382,3389,3396,3404,3412,3420,3428,3435,3442,3450,3457,3464,3471,3479,3487],{"type":49,"tag":204,"props":3383,"children":3384},{"class":206,"line":207},[3385],{"type":49,"tag":204,"props":3386,"children":3387},{},[3388],{"type":63,"value":1067},{"type":49,"tag":204,"props":3390,"children":3391},{"class":206,"line":217},[3392],{"type":49,"tag":204,"props":3393,"children":3394},{"emptyLinePlaceholder":43},[3395],{"type":63,"value":303},{"type":49,"tag":204,"props":3397,"children":3398},{"class":206,"line":297},[3399],{"type":49,"tag":204,"props":3400,"children":3401},{},[3402],{"type":63,"value":3403},"headers = {\n",{"type":49,"tag":204,"props":3405,"children":3406},{"class":206,"line":306},[3407],{"type":49,"tag":204,"props":3408,"children":3409},{},[3410],{"type":63,"value":3411},"    \"sentry-trace\": \"4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-1\",\n",{"type":49,"tag":204,"props":3413,"children":3414},{"class":206,"line":315},[3415],{"type":49,"tag":204,"props":3416,"children":3417},{},[3418],{"type":63,"value":3419},"    \"baggage\": \"sentry-trace_id=...\",\n",{"type":49,"tag":204,"props":3421,"children":3422},{"class":206,"line":380},[3423],{"type":49,"tag":204,"props":3424,"children":3425},{},[3426],{"type":63,"value":3427},"}\n",{"type":49,"tag":204,"props":3429,"children":3430},{"class":206,"line":388},[3431],{"type":49,"tag":204,"props":3432,"children":3433},{"emptyLinePlaceholder":43},[3434],{"type":63,"value":303},{"type":49,"tag":204,"props":3436,"children":3437},{"class":206,"line":397},[3438],{"type":49,"tag":204,"props":3439,"children":3440},{},[3441],{"type":63,"value":1082},{"type":49,"tag":204,"props":3443,"children":3444},{"class":206,"line":462},[3445],{"type":49,"tag":204,"props":3446,"children":3447},{},[3448],{"type":63,"value":3449},"with sentry_sdk.continue_trace(headers) as transaction:\n",{"type":49,"tag":204,"props":3451,"children":3452},{"class":206,"line":470},[3453],{"type":49,"tag":204,"props":3454,"children":3455},{},[3456],{"type":63,"value":1273},{"type":49,"tag":204,"props":3458,"children":3459},{"class":206,"line":479},[3460],{"type":49,"tag":204,"props":3461,"children":3462},{"emptyLinePlaceholder":43},[3463],{"type":63,"value":303},{"type":49,"tag":204,"props":3465,"children":3466},{"class":206,"line":544},[3467],{"type":49,"tag":204,"props":3468,"children":3469},{},[3470],{"type":63,"value":1129},{"type":49,"tag":204,"props":3472,"children":3473},{"class":206,"line":552},[3474],{"type":49,"tag":204,"props":3475,"children":3476},{},[3477],{"type":63,"value":3478},"sentry_sdk.traces.continue_trace(headers)\n",{"type":49,"tag":204,"props":3480,"children":3481},{"class":206,"line":561},[3482],{"type":49,"tag":204,"props":3483,"children":3484},{},[3485],{"type":63,"value":3486},"with sentry_sdk.traces.start_span(name=\"handle request\"):\n",{"type":49,"tag":204,"props":3488,"children":3489},{"class":206,"line":626},[3490],{"type":49,"tag":204,"props":3491,"children":3492},{},[3493],{"type":63,"value":1273},{"type":49,"tag":54,"props":3495,"children":3496},{},[3497,3499,3505],{"type":63,"value":3498},"To start a completely new trace, use ",{"type":49,"tag":88,"props":3500,"children":3502},{"className":3501},[],[3503],{"type":63,"value":3504},"sentry_sdk.traces.new_trace()",{"type":63,"value":1051},{"type":49,"tag":193,"props":3507,"children":3509},{"className":1054,"code":3508,"language":25,"meta":198,"style":198},"import sentry_sdk\n\nwith sentry_sdk.traces.start_span(name=\"span in trace 1\"):\n    ...\n\nsentry_sdk.traces.new_trace()\n\nwith sentry_sdk.traces.start_span(name=\"span in trace 2\"):\n    # This span is the root of a new, separate trace\n    ...\n",[3510],{"type":49,"tag":88,"props":3511,"children":3512},{"__ignoreMap":198},[3513,3520,3527,3535,3542,3549,3557,3564,3572,3580],{"type":49,"tag":204,"props":3514,"children":3515},{"class":206,"line":207},[3516],{"type":49,"tag":204,"props":3517,"children":3518},{},[3519],{"type":63,"value":1067},{"type":49,"tag":204,"props":3521,"children":3522},{"class":206,"line":217},[3523],{"type":49,"tag":204,"props":3524,"children":3525},{"emptyLinePlaceholder":43},[3526],{"type":63,"value":303},{"type":49,"tag":204,"props":3528,"children":3529},{"class":206,"line":297},[3530],{"type":49,"tag":204,"props":3531,"children":3532},{},[3533],{"type":63,"value":3534},"with sentry_sdk.traces.start_span(name=\"span in trace 1\"):\n",{"type":49,"tag":204,"props":3536,"children":3537},{"class":206,"line":306},[3538],{"type":49,"tag":204,"props":3539,"children":3540},{},[3541],{"type":63,"value":1273},{"type":49,"tag":204,"props":3543,"children":3544},{"class":206,"line":315},[3545],{"type":49,"tag":204,"props":3546,"children":3547},{"emptyLinePlaceholder":43},[3548],{"type":63,"value":303},{"type":49,"tag":204,"props":3550,"children":3551},{"class":206,"line":380},[3552],{"type":49,"tag":204,"props":3553,"children":3554},{},[3555],{"type":63,"value":3556},"sentry_sdk.traces.new_trace()\n",{"type":49,"tag":204,"props":3558,"children":3559},{"class":206,"line":388},[3560],{"type":49,"tag":204,"props":3561,"children":3562},{"emptyLinePlaceholder":43},[3563],{"type":63,"value":303},{"type":49,"tag":204,"props":3565,"children":3566},{"class":206,"line":397},[3567],{"type":49,"tag":204,"props":3568,"children":3569},{},[3570],{"type":63,"value":3571},"with sentry_sdk.traces.start_span(name=\"span in trace 2\"):\n",{"type":49,"tag":204,"props":3573,"children":3574},{"class":206,"line":462},[3575],{"type":49,"tag":204,"props":3576,"children":3577},{},[3578],{"type":63,"value":3579},"    # This span is the root of a new, separate trace\n",{"type":49,"tag":204,"props":3581,"children":3582},{"class":206,"line":470},[3583],{"type":49,"tag":204,"props":3584,"children":3585},{},[3586],{"type":63,"value":1273},{"type":49,"tag":186,"props":3588,"children":3590},{"id":3589},"migrate-sampling",[3591],{"type":63,"value":3592},"Migrate Sampling",{"type":49,"tag":54,"props":3594,"children":3595},{},[3596,3598,3603],{"type":63,"value":3597},"If you use ",{"type":49,"tag":88,"props":3599,"children":3601},{"className":3600},[],[3602],{"type":63,"value":1021},{"type":63,"value":3604},", no changes are needed — it works the same way.",{"type":49,"tag":54,"props":3606,"children":3607},{},[3608,3610,3615],{"type":63,"value":3609},"If you use a custom ",{"type":49,"tag":88,"props":3611,"children":3613},{"className":3612},[],[3614],{"type":63,"value":1029},{"type":63,"value":3616},", the sampling context has a different structure in streaming mode:",{"type":49,"tag":193,"props":3618,"children":3620},{"className":1054,"code":3619,"language":25,"meta":198,"style":198},"def traces_sampler(sampling_context):\n    # sampling_context[\"span_context\"] contains:\n    #   name, trace_id, parent_span_id, parent_sampled, attributes\n    if sampling_context[\"span_context\"][\"name\"] in IGNORED_SPAN_NAMES:\n        return 0.0\n    return 1.0\n\nsentry_sdk.init(\n    traces_sampler=traces_sampler,\n    trace_lifecycle=\"stream\",\n)\n",[3621],{"type":49,"tag":88,"props":3622,"children":3623},{"__ignoreMap":198},[3624,3632,3640,3648,3656,3664,3672,3679,3686,3694,3701],{"type":49,"tag":204,"props":3625,"children":3626},{"class":206,"line":207},[3627],{"type":49,"tag":204,"props":3628,"children":3629},{},[3630],{"type":63,"value":3631},"def traces_sampler(sampling_context):\n",{"type":49,"tag":204,"props":3633,"children":3634},{"class":206,"line":217},[3635],{"type":49,"tag":204,"props":3636,"children":3637},{},[3638],{"type":63,"value":3639},"    # sampling_context[\"span_context\"] contains:\n",{"type":49,"tag":204,"props":3641,"children":3642},{"class":206,"line":297},[3643],{"type":49,"tag":204,"props":3644,"children":3645},{},[3646],{"type":63,"value":3647},"    #   name, trace_id, parent_span_id, parent_sampled, attributes\n",{"type":49,"tag":204,"props":3649,"children":3650},{"class":206,"line":306},[3651],{"type":49,"tag":204,"props":3652,"children":3653},{},[3654],{"type":63,"value":3655},"    if sampling_context[\"span_context\"][\"name\"] in IGNORED_SPAN_NAMES:\n",{"type":49,"tag":204,"props":3657,"children":3658},{"class":206,"line":315},[3659],{"type":49,"tag":204,"props":3660,"children":3661},{},[3662],{"type":63,"value":3663},"        return 0.0\n",{"type":49,"tag":204,"props":3665,"children":3666},{"class":206,"line":380},[3667],{"type":49,"tag":204,"props":3668,"children":3669},{},[3670],{"type":63,"value":3671},"    return 1.0\n",{"type":49,"tag":204,"props":3673,"children":3674},{"class":206,"line":388},[3675],{"type":49,"tag":204,"props":3676,"children":3677},{"emptyLinePlaceholder":43},[3678],{"type":63,"value":303},{"type":49,"tag":204,"props":3680,"children":3681},{"class":206,"line":397},[3682],{"type":49,"tag":204,"props":3683,"children":3684},{},[3685],{"type":63,"value":1090},{"type":49,"tag":204,"props":3687,"children":3688},{"class":206,"line":462},[3689],{"type":49,"tag":204,"props":3690,"children":3691},{},[3692],{"type":63,"value":3693},"    traces_sampler=traces_sampler,\n",{"type":49,"tag":204,"props":3695,"children":3696},{"class":206,"line":470},[3697],{"type":49,"tag":204,"props":3698,"children":3699},{},[3700],{"type":63,"value":1158},{"type":49,"tag":204,"props":3702,"children":3703},{"class":206,"line":479},[3704],{"type":49,"tag":204,"props":3705,"children":3706},{},[3707],{"type":63,"value":1114},{"type":49,"tag":54,"props":3709,"children":3710},{},[3711,3713,3719,3721,3727],{"type":63,"value":3712},"The sampling decision is made when ",{"type":49,"tag":88,"props":3714,"children":3716},{"className":3715},[],[3717],{"type":63,"value":3718},"start_span()",{"type":63,"value":3720}," is called. Child spans inherit the parent's sampling decision unless filtered by ",{"type":49,"tag":88,"props":3722,"children":3724},{"className":3723},[],[3725],{"type":63,"value":3726},"ignore_spans",{"type":63,"value":124},{"type":49,"tag":1202,"props":3729,"children":3731},{"id":3730},"custom-sampling-context",[3732],{"type":63,"value":3733},"Custom Sampling Context",{"type":49,"tag":54,"props":3735,"children":3736},{},[3737,3739,3744],{"type":63,"value":3738},"Custom sampling context is no longer an argument to ",{"type":49,"tag":88,"props":3740,"children":3742},{"className":3741},[],[3743],{"type":63,"value":173},{"type":63,"value":3745},". Set it on the scope before starting the span:",{"type":49,"tag":193,"props":3747,"children":3749},{"className":1054,"code":3748,"language":25,"meta":198,"style":198},"import sentry_sdk\n\ndef traces_sampler(sampling_context):\n    if sampling_context[\"asgi_scope\"].method not in (\"GET\", \"POST\"):\n        return 0.0\n    return 1.0\n\n# Before\nwith sentry_sdk.start_span(\n    name=\"handle request\",\n    custom_sampling_context={\"asgi_scope\": asgi_scope},\n):\n    ...\n\n# After\nsentry_sdk.Scope.set_custom_sampling_context({\"asgi_scope\": asgi_scope})\nwith sentry_sdk.traces.start_span(name=\"handle request\"):\n    ...\n",[3750],{"type":49,"tag":88,"props":3751,"children":3752},{"__ignoreMap":198},[3753,3760,3767,3774,3782,3789,3796,3803,3810,3818,3826,3834,3842,3849,3856,3863,3871,3878],{"type":49,"tag":204,"props":3754,"children":3755},{"class":206,"line":207},[3756],{"type":49,"tag":204,"props":3757,"children":3758},{},[3759],{"type":63,"value":1067},{"type":49,"tag":204,"props":3761,"children":3762},{"class":206,"line":217},[3763],{"type":49,"tag":204,"props":3764,"children":3765},{"emptyLinePlaceholder":43},[3766],{"type":63,"value":303},{"type":49,"tag":204,"props":3768,"children":3769},{"class":206,"line":297},[3770],{"type":49,"tag":204,"props":3771,"children":3772},{},[3773],{"type":63,"value":3631},{"type":49,"tag":204,"props":3775,"children":3776},{"class":206,"line":306},[3777],{"type":49,"tag":204,"props":3778,"children":3779},{},[3780],{"type":63,"value":3781},"    if sampling_context[\"asgi_scope\"].method not in (\"GET\", \"POST\"):\n",{"type":49,"tag":204,"props":3783,"children":3784},{"class":206,"line":315},[3785],{"type":49,"tag":204,"props":3786,"children":3787},{},[3788],{"type":63,"value":3663},{"type":49,"tag":204,"props":3790,"children":3791},{"class":206,"line":380},[3792],{"type":49,"tag":204,"props":3793,"children":3794},{},[3795],{"type":63,"value":3671},{"type":49,"tag":204,"props":3797,"children":3798},{"class":206,"line":388},[3799],{"type":49,"tag":204,"props":3800,"children":3801},{"emptyLinePlaceholder":43},[3802],{"type":63,"value":303},{"type":49,"tag":204,"props":3804,"children":3805},{"class":206,"line":397},[3806],{"type":49,"tag":204,"props":3807,"children":3808},{},[3809],{"type":63,"value":1082},{"type":49,"tag":204,"props":3811,"children":3812},{"class":206,"line":462},[3813],{"type":49,"tag":204,"props":3814,"children":3815},{},[3816],{"type":63,"value":3817},"with sentry_sdk.start_span(\n",{"type":49,"tag":204,"props":3819,"children":3820},{"class":206,"line":470},[3821],{"type":49,"tag":204,"props":3822,"children":3823},{},[3824],{"type":63,"value":3825},"    name=\"handle request\",\n",{"type":49,"tag":204,"props":3827,"children":3828},{"class":206,"line":479},[3829],{"type":49,"tag":204,"props":3830,"children":3831},{},[3832],{"type":63,"value":3833},"    custom_sampling_context={\"asgi_scope\": asgi_scope},\n",{"type":49,"tag":204,"props":3835,"children":3836},{"class":206,"line":544},[3837],{"type":49,"tag":204,"props":3838,"children":3839},{},[3840],{"type":63,"value":3841},"):\n",{"type":49,"tag":204,"props":3843,"children":3844},{"class":206,"line":552},[3845],{"type":49,"tag":204,"props":3846,"children":3847},{},[3848],{"type":63,"value":1273},{"type":49,"tag":204,"props":3850,"children":3851},{"class":206,"line":561},[3852],{"type":49,"tag":204,"props":3853,"children":3854},{"emptyLinePlaceholder":43},[3855],{"type":63,"value":303},{"type":49,"tag":204,"props":3857,"children":3858},{"class":206,"line":626},[3859],{"type":49,"tag":204,"props":3860,"children":3861},{},[3862],{"type":63,"value":1129},{"type":49,"tag":204,"props":3864,"children":3865},{"class":206,"line":634},[3866],{"type":49,"tag":204,"props":3867,"children":3868},{},[3869],{"type":63,"value":3870},"sentry_sdk.Scope.set_custom_sampling_context({\"asgi_scope\": asgi_scope})\n",{"type":49,"tag":204,"props":3872,"children":3873},{"class":206,"line":643},[3874],{"type":49,"tag":204,"props":3875,"children":3876},{},[3877],{"type":63,"value":3486},{"type":49,"tag":204,"props":3879,"children":3880},{"class":206,"line":708},[3881],{"type":49,"tag":204,"props":3882,"children":3883},{},[3884],{"type":63,"value":1273},{"type":49,"tag":54,"props":3886,"children":3887},{},[3888,3890,3895,3896,3901,3903,3908,3909,3914],{"type":63,"value":3889},"Custom sampling context must be set ",{"type":49,"tag":994,"props":3891,"children":3892},{},[3893],{"type":63,"value":3894},"after",{"type":63,"value":1000},{"type":49,"tag":88,"props":3897,"children":3899},{"className":3898},[],[3900],{"type":63,"value":497},{"type":63,"value":3902}," (which resets propagation context) and ",{"type":49,"tag":994,"props":3904,"children":3905},{},[3906],{"type":63,"value":3907},"before",{"type":63,"value":1000},{"type":49,"tag":88,"props":3910,"children":3912},{"className":3911},[],[3913],{"type":63,"value":173},{"type":63,"value":3915}," (which is when sampling happens).",{"type":49,"tag":186,"props":3917,"children":3919},{"id":3918},"configure-ignore_spans-optional",[3920,3922,3927],{"type":63,"value":3921},"Configure ",{"type":49,"tag":88,"props":3923,"children":3925},{"className":3924},[],[3926],{"type":63,"value":3726},{"type":63,"value":3928}," (Optional)",{"type":49,"tag":54,"props":3930,"children":3931},{},[3932,3937,3939,3944,3946,3951],{"type":49,"tag":88,"props":3933,"children":3935},{"className":3934},[],[3936],{"type":63,"value":3726},{"type":63,"value":3938}," filters spans at creation time. Rules can be strings, compiled regexes, or dictionaries with ",{"type":49,"tag":88,"props":3940,"children":3942},{"className":3941},[],[3943],{"type":63,"value":1368},{"type":63,"value":3945}," and\u002For ",{"type":49,"tag":88,"props":3947,"children":3949},{"className":3948},[],[3950],{"type":63,"value":1379},{"type":63,"value":3952}," conditions:",{"type":49,"tag":193,"props":3954,"children":3956},{"className":1054,"code":3955,"language":25,"meta":198,"style":198},"import re\nimport sentry_sdk\n\nsentry_sdk.init(\n    trace_lifecycle=\"stream\",\n    ignore_spans=[\n        # String match against span name\n        \"\u002Fhealth\",\n\n        # Regex match against span name\n        re.compile(r\"\u002Fflow\u002F.*\"),\n\n        # Match by attributes (all must match)\n        {\n            \"attributes\": {\n                \"service.id\": \"15def9a\",\n                \"flow.pipeline\": \"legacy\",\n            }\n        },\n\n        # Match by name and attributes\n        {\n            \"name\": re.compile(r\"\u002Fflow\u002F.*\"),\n            \"attributes\": {\n                \"service.id\": re.compile(r\".*\\.facade\"),\n            },\n        },\n    ],\n)\n",[3957],{"type":49,"tag":88,"props":3958,"children":3959},{"__ignoreMap":198},[3960,3968,3975,3982,3989,3996,4004,4012,4020,4027,4035,4043,4050,4058,4066,4074,4082,4090,4098,4106,4113,4121,4128,4136,4143,4151,4159,4167,4176],{"type":49,"tag":204,"props":3961,"children":3962},{"class":206,"line":207},[3963],{"type":49,"tag":204,"props":3964,"children":3965},{},[3966],{"type":63,"value":3967},"import re\n",{"type":49,"tag":204,"props":3969,"children":3970},{"class":206,"line":217},[3971],{"type":49,"tag":204,"props":3972,"children":3973},{},[3974],{"type":63,"value":1067},{"type":49,"tag":204,"props":3976,"children":3977},{"class":206,"line":297},[3978],{"type":49,"tag":204,"props":3979,"children":3980},{"emptyLinePlaceholder":43},[3981],{"type":63,"value":303},{"type":49,"tag":204,"props":3983,"children":3984},{"class":206,"line":306},[3985],{"type":49,"tag":204,"props":3986,"children":3987},{},[3988],{"type":63,"value":1090},{"type":49,"tag":204,"props":3990,"children":3991},{"class":206,"line":315},[3992],{"type":49,"tag":204,"props":3993,"children":3994},{},[3995],{"type":63,"value":1158},{"type":49,"tag":204,"props":3997,"children":3998},{"class":206,"line":380},[3999],{"type":49,"tag":204,"props":4000,"children":4001},{},[4002],{"type":63,"value":4003},"    ignore_spans=[\n",{"type":49,"tag":204,"props":4005,"children":4006},{"class":206,"line":388},[4007],{"type":49,"tag":204,"props":4008,"children":4009},{},[4010],{"type":63,"value":4011},"        # String match against span name\n",{"type":49,"tag":204,"props":4013,"children":4014},{"class":206,"line":397},[4015],{"type":49,"tag":204,"props":4016,"children":4017},{},[4018],{"type":63,"value":4019},"        \"\u002Fhealth\",\n",{"type":49,"tag":204,"props":4021,"children":4022},{"class":206,"line":462},[4023],{"type":49,"tag":204,"props":4024,"children":4025},{"emptyLinePlaceholder":43},[4026],{"type":63,"value":303},{"type":49,"tag":204,"props":4028,"children":4029},{"class":206,"line":470},[4030],{"type":49,"tag":204,"props":4031,"children":4032},{},[4033],{"type":63,"value":4034},"        # Regex match against span name\n",{"type":49,"tag":204,"props":4036,"children":4037},{"class":206,"line":479},[4038],{"type":49,"tag":204,"props":4039,"children":4040},{},[4041],{"type":63,"value":4042},"        re.compile(r\"\u002Fflow\u002F.*\"),\n",{"type":49,"tag":204,"props":4044,"children":4045},{"class":206,"line":544},[4046],{"type":49,"tag":204,"props":4047,"children":4048},{"emptyLinePlaceholder":43},[4049],{"type":63,"value":303},{"type":49,"tag":204,"props":4051,"children":4052},{"class":206,"line":552},[4053],{"type":49,"tag":204,"props":4054,"children":4055},{},[4056],{"type":63,"value":4057},"        # Match by attributes (all must match)\n",{"type":49,"tag":204,"props":4059,"children":4060},{"class":206,"line":561},[4061],{"type":49,"tag":204,"props":4062,"children":4063},{},[4064],{"type":63,"value":4065},"        {\n",{"type":49,"tag":204,"props":4067,"children":4068},{"class":206,"line":626},[4069],{"type":49,"tag":204,"props":4070,"children":4071},{},[4072],{"type":63,"value":4073},"            \"attributes\": {\n",{"type":49,"tag":204,"props":4075,"children":4076},{"class":206,"line":634},[4077],{"type":49,"tag":204,"props":4078,"children":4079},{},[4080],{"type":63,"value":4081},"                \"service.id\": \"15def9a\",\n",{"type":49,"tag":204,"props":4083,"children":4084},{"class":206,"line":643},[4085],{"type":49,"tag":204,"props":4086,"children":4087},{},[4088],{"type":63,"value":4089},"                \"flow.pipeline\": \"legacy\",\n",{"type":49,"tag":204,"props":4091,"children":4092},{"class":206,"line":708},[4093],{"type":49,"tag":204,"props":4094,"children":4095},{},[4096],{"type":63,"value":4097},"            }\n",{"type":49,"tag":204,"props":4099,"children":4100},{"class":206,"line":716},[4101],{"type":49,"tag":204,"props":4102,"children":4103},{},[4104],{"type":63,"value":4105},"        },\n",{"type":49,"tag":204,"props":4107,"children":4108},{"class":206,"line":725},[4109],{"type":49,"tag":204,"props":4110,"children":4111},{"emptyLinePlaceholder":43},[4112],{"type":63,"value":303},{"type":49,"tag":204,"props":4114,"children":4115},{"class":206,"line":790},[4116],{"type":49,"tag":204,"props":4117,"children":4118},{},[4119],{"type":63,"value":4120},"        # Match by name and attributes\n",{"type":49,"tag":204,"props":4122,"children":4123},{"class":206,"line":798},[4124],{"type":49,"tag":204,"props":4125,"children":4126},{},[4127],{"type":63,"value":4065},{"type":49,"tag":204,"props":4129,"children":4130},{"class":206,"line":807},[4131],{"type":49,"tag":204,"props":4132,"children":4133},{},[4134],{"type":63,"value":4135},"            \"name\": re.compile(r\"\u002Fflow\u002F.*\"),\n",{"type":49,"tag":204,"props":4137,"children":4138},{"class":206,"line":872},[4139],{"type":49,"tag":204,"props":4140,"children":4141},{},[4142],{"type":63,"value":4073},{"type":49,"tag":204,"props":4144,"children":4145},{"class":206,"line":880},[4146],{"type":49,"tag":204,"props":4147,"children":4148},{},[4149],{"type":63,"value":4150},"                \"service.id\": re.compile(r\".*\\.facade\"),\n",{"type":49,"tag":204,"props":4152,"children":4153},{"class":206,"line":889},[4154],{"type":49,"tag":204,"props":4155,"children":4156},{},[4157],{"type":63,"value":4158},"            },\n",{"type":49,"tag":204,"props":4160,"children":4162},{"class":206,"line":4161},27,[4163],{"type":49,"tag":204,"props":4164,"children":4165},{},[4166],{"type":63,"value":4105},{"type":49,"tag":204,"props":4168,"children":4170},{"class":206,"line":4169},28,[4171],{"type":49,"tag":204,"props":4172,"children":4173},{},[4174],{"type":63,"value":4175},"    ],\n",{"type":49,"tag":204,"props":4177,"children":4179},{"class":206,"line":4178},29,[4180],{"type":49,"tag":204,"props":4181,"children":4182},{},[4183],{"type":63,"value":1114},{"type":49,"tag":54,"props":4185,"children":4186},{},[4187,4192,4194,4200],{"type":49,"tag":88,"props":4188,"children":4190},{"className":4189},[],[4191],{"type":63,"value":3726},{"type":63,"value":4193}," only takes effect when ",{"type":49,"tag":88,"props":4195,"children":4197},{"className":4196},[],[4198],{"type":63,"value":4199},"trace_lifecycle=\"stream\"",{"type":63,"value":4201}," is enabled. If it is set without span streaming, the SDK emits a warning and the option is ignored.",{"type":49,"tag":54,"props":4203,"children":4204},{},[4205],{"type":63,"value":4206},"Only the span name and attributes set at creation time are available for matching — attributes added later in the span's lifetime are not considered.",{"type":49,"tag":54,"props":4208,"children":4209},{},[4210],{"type":63,"value":4211},"If an ignored span is a top-level span, its entire subtree is also ignored. If a non-top-level span is ignored, its children are not automatically ignored unless they match a rule themselves.",{"type":49,"tag":186,"props":4213,"children":4215},{"id":4214},"migrate-before_send_transaction",[4216,4218],{"type":63,"value":4217},"Migrate ",{"type":49,"tag":88,"props":4219,"children":4221},{"className":4220},[],[4222],{"type":63,"value":579},{"type":49,"tag":54,"props":4224,"children":4225},{},[4226,4231],{"type":49,"tag":88,"props":4227,"children":4229},{"className":4228},[],[4230],{"type":63,"value":579},{"type":63,"value":4232}," has no effect in streaming mode. Spans are sent individually as they complete, not batched into transactions.",{"type":49,"tag":54,"props":4234,"children":4235},{},[4236,4240,4242,4247,4249,4254,4255,4261,4263,4269,4271,4276],{"type":49,"tag":994,"props":4237,"children":4238},{},[4239],{"type":63,"value":2747},{"type":63,"value":4241}," In the legacy transaction-based model, ",{"type":49,"tag":88,"props":4243,"children":4245},{"className":4244},[],[4246],{"type":63,"value":579},{"type":63,"value":4248}," ran after the entire transaction finished, so it had access to all data set during the span's lifetime (e.g. HTTP status codes, response sizes, final results). In streaming mode, the replacements (",{"type":49,"tag":88,"props":4250,"children":4252},{"className":4251},[],[4253],{"type":63,"value":3726},{"type":63,"value":1186},{"type":49,"tag":88,"props":4256,"children":4258},{"className":4257},[],[4259],{"type":63,"value":4260},"before_send_span",{"type":63,"value":4262},") can only work with attributes set at span start time. Attributes added later during the span's lifetime (like ",{"type":49,"tag":88,"props":4264,"children":4266},{"className":4265},[],[4267],{"type":63,"value":4268},"http.response.status_code",{"type":63,"value":4270},", response body size, or other late-set data) are ",{"type":49,"tag":994,"props":4272,"children":4273},{},[4274],{"type":63,"value":4275},"not available",{"type":63,"value":124},{"type":49,"tag":54,"props":4278,"children":4279},{},[4280,4292,4294,4299],{"type":49,"tag":994,"props":4281,"children":4282},{},[4283,4285,4290],{"type":63,"value":4284},"If your ",{"type":49,"tag":88,"props":4286,"children":4288},{"className":4287},[],[4289],{"type":63,"value":579},{"type":63,"value":4291}," logic depends on attributes not set at span start",{"type":63,"value":4293},", that filtering logic ",{"type":49,"tag":994,"props":4295,"children":4296},{},[4297],{"type":63,"value":4298},"cannot be replicated",{"type":63,"value":4300}," in streaming mode and must be removed. Consider moving such filtering to a server-side mechanism (e.g. Sentry inbound data filters or Relay rules) instead.",{"type":49,"tag":4302,"props":4303,"children":4304},"table",{},[4305,4324],{"type":49,"tag":4306,"props":4307,"children":4308},"thead",{},[4309],{"type":49,"tag":4310,"props":4311,"children":4312},"tr",{},[4313,4319],{"type":49,"tag":4314,"props":4315,"children":4316},"th",{},[4317],{"type":63,"value":4318},"Use Case",{"type":49,"tag":4314,"props":4320,"children":4321},{},[4322],{"type":63,"value":4323},"Streaming Replacement",{"type":49,"tag":4325,"props":4326,"children":4327},"tbody",{},[4328,4347,4365,4382],{"type":49,"tag":4310,"props":4329,"children":4330},{},[4331,4337],{"type":49,"tag":4332,"props":4333,"children":4334},"td",{},[4335],{"type":63,"value":4336},"Drop spans by name\u002Froute",{"type":49,"tag":4332,"props":4338,"children":4339},{},[4340,4342],{"type":63,"value":4341},"Use ",{"type":49,"tag":88,"props":4343,"children":4345},{"className":4344},[],[4346],{"type":63,"value":3726},{"type":49,"tag":4310,"props":4348,"children":4349},{},[4350,4355],{"type":49,"tag":4332,"props":4351,"children":4352},{},[4353],{"type":63,"value":4354},"Drop\u002Ffilter by late-set attributes (e.g. HTTP status code)",{"type":49,"tag":4332,"props":4356,"children":4357},{},[4358,4363],{"type":49,"tag":994,"props":4359,"children":4360},{},[4361],{"type":63,"value":4362},"Cannot be replicated",{"type":63,"value":4364}," — remove the logic or use server-side filtering",{"type":49,"tag":4310,"props":4366,"children":4367},{},[4368,4373],{"type":49,"tag":4332,"props":4369,"children":4370},{},[4371],{"type":63,"value":4372},"Modify span data before send",{"type":49,"tag":4332,"props":4374,"children":4375},{},[4376,4377],{"type":63,"value":4341},{"type":49,"tag":88,"props":4378,"children":4380},{"className":4379},[],[4381],{"type":63,"value":4260},{"type":49,"tag":4310,"props":4383,"children":4384},{},[4385,4390],{"type":49,"tag":4332,"props":4386,"children":4387},{},[4388],{"type":63,"value":4389},"Filter by transaction name",{"type":49,"tag":4332,"props":4391,"children":4392},{},[4393,4394,4399],{"type":63,"value":4341},{"type":49,"tag":88,"props":4395,"children":4397},{"className":4396},[],[4398],{"type":63,"value":3726},{"type":63,"value":4400}," with string\u002Fregex pattern",{"type":49,"tag":54,"props":4402,"children":4403},{},[4404,4406,4411,4413,4418],{"type":63,"value":4405},"Remove the ",{"type":49,"tag":88,"props":4407,"children":4409},{"className":4408},[],[4410],{"type":63,"value":579},{"type":63,"value":4412}," option from ",{"type":49,"tag":88,"props":4414,"children":4416},{"className":4415},[],[4417],{"type":63,"value":1049},{"type":63,"value":4419}," after migrating its logic.",{"type":49,"tag":186,"props":4421,"children":4423},{"id":4422},"configure-before_send_span-optional",[4424,4425,4430],{"type":63,"value":3921},{"type":49,"tag":88,"props":4426,"children":4428},{"className":4427},[],[4429],{"type":63,"value":4260},{"type":63,"value":3928},{"type":49,"tag":54,"props":4432,"children":4433},{},[4434,4439,4441,4446,4447,4453],{"type":49,"tag":88,"props":4435,"children":4437},{"className":4436},[],[4438],{"type":63,"value":4260},{"type":63,"value":4440}," lets you modify spans before they leave the SDK, for example to sanitize sensitive values. It receives ",{"type":49,"tag":88,"props":4442,"children":4444},{"className":4443},[],[4445],{"type":63,"value":204},{"type":63,"value":1186},{"type":49,"tag":88,"props":4448,"children":4450},{"className":4449},[],[4451],{"type":63,"value":4452},"hint",{"type":63,"value":4454}," arguments and must return a span:",{"type":49,"tag":193,"props":4456,"children":4458},{"className":1054,"code":4457,"language":25,"meta":198,"style":198},"import sentry_sdk\n\ndef postprocess_span(span, hint):\n    attributes_to_sanitize = [\n        \"http.request.header.custom-auth\",\n        \"http.request.header.custom-user-id\",\n    ]\n    for attribute in attributes_to_sanitize:\n        if span[\"attributes\"].get(attribute):\n            span[\"attributes\"][attribute] = \"[Sanitized]\"\n    return span\n\nsentry_sdk.init(\n    trace_lifecycle=\"stream\",\n    _experiments={\n        \"before_send_span\": postprocess_span,\n    },\n)\n",[4459],{"type":49,"tag":88,"props":4460,"children":4461},{"__ignoreMap":198},[4462,4469,4476,4484,4492,4500,4508,4516,4524,4532,4540,4548,4555,4562,4569,4577,4585,4593],{"type":49,"tag":204,"props":4463,"children":4464},{"class":206,"line":207},[4465],{"type":49,"tag":204,"props":4466,"children":4467},{},[4468],{"type":63,"value":1067},{"type":49,"tag":204,"props":4470,"children":4471},{"class":206,"line":217},[4472],{"type":49,"tag":204,"props":4473,"children":4474},{"emptyLinePlaceholder":43},[4475],{"type":63,"value":303},{"type":49,"tag":204,"props":4477,"children":4478},{"class":206,"line":297},[4479],{"type":49,"tag":204,"props":4480,"children":4481},{},[4482],{"type":63,"value":4483},"def postprocess_span(span, hint):\n",{"type":49,"tag":204,"props":4485,"children":4486},{"class":206,"line":306},[4487],{"type":49,"tag":204,"props":4488,"children":4489},{},[4490],{"type":63,"value":4491},"    attributes_to_sanitize = [\n",{"type":49,"tag":204,"props":4493,"children":4494},{"class":206,"line":315},[4495],{"type":49,"tag":204,"props":4496,"children":4497},{},[4498],{"type":63,"value":4499},"        \"http.request.header.custom-auth\",\n",{"type":49,"tag":204,"props":4501,"children":4502},{"class":206,"line":380},[4503],{"type":49,"tag":204,"props":4504,"children":4505},{},[4506],{"type":63,"value":4507},"        \"http.request.header.custom-user-id\",\n",{"type":49,"tag":204,"props":4509,"children":4510},{"class":206,"line":388},[4511],{"type":49,"tag":204,"props":4512,"children":4513},{},[4514],{"type":63,"value":4515},"    ]\n",{"type":49,"tag":204,"props":4517,"children":4518},{"class":206,"line":397},[4519],{"type":49,"tag":204,"props":4520,"children":4521},{},[4522],{"type":63,"value":4523},"    for attribute in attributes_to_sanitize:\n",{"type":49,"tag":204,"props":4525,"children":4526},{"class":206,"line":462},[4527],{"type":49,"tag":204,"props":4528,"children":4529},{},[4530],{"type":63,"value":4531},"        if span[\"attributes\"].get(attribute):\n",{"type":49,"tag":204,"props":4533,"children":4534},{"class":206,"line":470},[4535],{"type":49,"tag":204,"props":4536,"children":4537},{},[4538],{"type":63,"value":4539},"            span[\"attributes\"][attribute] = \"[Sanitized]\"\n",{"type":49,"tag":204,"props":4541,"children":4542},{"class":206,"line":479},[4543],{"type":49,"tag":204,"props":4544,"children":4545},{},[4546],{"type":63,"value":4547},"    return span\n",{"type":49,"tag":204,"props":4549,"children":4550},{"class":206,"line":544},[4551],{"type":49,"tag":204,"props":4552,"children":4553},{"emptyLinePlaceholder":43},[4554],{"type":63,"value":303},{"type":49,"tag":204,"props":4556,"children":4557},{"class":206,"line":552},[4558],{"type":49,"tag":204,"props":4559,"children":4560},{},[4561],{"type":63,"value":1090},{"type":49,"tag":204,"props":4563,"children":4564},{"class":206,"line":561},[4565],{"type":49,"tag":204,"props":4566,"children":4567},{},[4568],{"type":63,"value":1158},{"type":49,"tag":204,"props":4570,"children":4571},{"class":206,"line":626},[4572],{"type":49,"tag":204,"props":4573,"children":4574},{},[4575],{"type":63,"value":4576},"    _experiments={\n",{"type":49,"tag":204,"props":4578,"children":4579},{"class":206,"line":634},[4580],{"type":49,"tag":204,"props":4581,"children":4582},{},[4583],{"type":63,"value":4584},"        \"before_send_span\": postprocess_span,\n",{"type":49,"tag":204,"props":4586,"children":4587},{"class":206,"line":643},[4588],{"type":49,"tag":204,"props":4589,"children":4590},{},[4591],{"type":63,"value":4592},"    },\n",{"type":49,"tag":204,"props":4594,"children":4595},{"class":206,"line":708},[4596],{"type":49,"tag":204,"props":4597,"children":4598},{},[4599],{"type":63,"value":1114},{"type":49,"tag":54,"props":4601,"children":4602},{},[4603,4608,4610,4615],{"type":49,"tag":88,"props":4604,"children":4606},{"className":4605},[],[4607],{"type":63,"value":4260},{"type":63,"value":4609}," cannot be used to drop spans — use ",{"type":49,"tag":88,"props":4611,"children":4613},{"className":4612},[],[4614],{"type":63,"value":3726},{"type":63,"value":4616}," for that. If the callback returns anything other than a span dictionary, the return value is ignored.",{"type":49,"tag":186,"props":4618,"children":4620},{"id":4619},"verification",[4621],{"type":63,"value":4622},"Verification",{"type":49,"tag":54,"props":4624,"children":4625},{},[4626],{"type":63,"value":4627},"Instruct the user to verify:",{"type":49,"tag":4629,"props":4630,"children":4631},"ol",{},[4632,4642],{"type":49,"tag":137,"props":4633,"children":4634},{},[4635,4640],{"type":49,"tag":994,"props":4636,"children":4637},{},[4638],{"type":63,"value":4639},"Check Sentry dashboard",{"type":63,"value":4641},": Spans should appear in the Traces view shortly after they complete, without waiting for the full transaction to finish",{"type":49,"tag":137,"props":4643,"children":4644},{},[4645,4650],{"type":49,"tag":994,"props":4646,"children":4647},{},[4648],{"type":63,"value":4649},"Check logs",{"type":63,"value":4651},": Ensure no SDK warnings about unsupported span operations",{"type":49,"tag":1202,"props":4653,"children":4655},{"id":4654},"common-issues",[4656],{"type":63,"value":4657},"Common Issues",{"type":49,"tag":4302,"props":4659,"children":4660},{},[4661,4682],{"type":49,"tag":4306,"props":4662,"children":4663},{},[4664],{"type":49,"tag":4310,"props":4665,"children":4666},{},[4667,4672,4677],{"type":49,"tag":4314,"props":4668,"children":4669},{},[4670],{"type":63,"value":4671},"Symptom",{"type":49,"tag":4314,"props":4673,"children":4674},{},[4675],{"type":63,"value":4676},"Cause",{"type":49,"tag":4314,"props":4678,"children":4679},{},[4680],{"type":63,"value":4681},"Fix",{"type":49,"tag":4325,"props":4683,"children":4684},{},[4685,4713,4753,4781,4816,4843,4890,4922,4954,5000,5034,5088],{"type":49,"tag":4310,"props":4686,"children":4687},{},[4688,4693,4703],{"type":49,"tag":4332,"props":4689,"children":4690},{},[4691],{"type":63,"value":4692},"Spans not streaming",{"type":49,"tag":4332,"props":4694,"children":4695},{},[4696,4698],{"type":63,"value":4697},"Using legacy ",{"type":49,"tag":88,"props":4699,"children":4701},{"className":4700},[],[4702],{"type":63,"value":1184},{"type":49,"tag":4332,"props":4704,"children":4705},{},[4706,4708],{"type":63,"value":4707},"Switch to ",{"type":49,"tag":88,"props":4709,"children":4711},{"className":4710},[],[4712],{"type":63,"value":1176},{"type":49,"tag":4310,"props":4714,"children":4715},{},[4716,4732,4742],{"type":49,"tag":4332,"props":4717,"children":4718},{},[4719,4725,4727],{"type":49,"tag":88,"props":4720,"children":4722},{"className":4721},[],[4723],{"type":63,"value":4724},"AttributeError",{"type":63,"value":4726}," on ",{"type":49,"tag":88,"props":4728,"children":4730},{"className":4729},[],[4731],{"type":63,"value":1650},{"type":49,"tag":4332,"props":4733,"children":4734},{},[4735,4740],{"type":49,"tag":88,"props":4736,"children":4738},{"className":4737},[],[4739],{"type":63,"value":1650},{"type":63,"value":4741}," removed in streaming mode",{"type":49,"tag":4332,"props":4743,"children":4744},{},[4745,4746,4751],{"type":63,"value":4341},{"type":49,"tag":88,"props":4747,"children":4749},{"className":4748},[],[4750],{"type":63,"value":1176},{"type":63,"value":4752}," while parent is active",{"type":49,"tag":4310,"props":4754,"children":4755},{},[4756,4766,4776],{"type":49,"tag":4332,"props":4757,"children":4758},{},[4759,4764],{"type":49,"tag":88,"props":4760,"children":4762},{"className":4761},[],[4763],{"type":63,"value":2737},{"type":63,"value":4765}," attribute value rejected",{"type":49,"tag":4332,"props":4767,"children":4768},{},[4769,4774],{"type":49,"tag":88,"props":4770,"children":4772},{"className":4771},[],[4773],{"type":63,"value":2737},{"type":63,"value":4775}," not supported as attribute value",{"type":49,"tag":4332,"props":4777,"children":4778},{},[4779],{"type":63,"value":4780},"Remove the attribute or use a sentinel string",{"type":49,"tag":4310,"props":4782,"children":4783},{},[4784,4801,4806],{"type":49,"tag":4332,"props":4785,"children":4786},{},[4787,4792,4794,4799],{"type":49,"tag":88,"props":4788,"children":4790},{"className":4789},[],[4791],{"type":63,"value":981},{"type":63,"value":4793},"\u002F",{"type":49,"tag":88,"props":4795,"children":4797},{"className":4796},[],[4798],{"type":63,"value":2762},{"type":63,"value":4800}," has no effect on span",{"type":49,"tag":4332,"props":4802,"children":4803},{},[4804],{"type":63,"value":4805},"These methods don't apply to streaming spans",{"type":49,"tag":4332,"props":4807,"children":4808},{},[4809,4810],{"type":63,"value":4341},{"type":49,"tag":88,"props":4811,"children":4813},{"className":4812},[],[4814],{"type":63,"value":4815},"span.set_attribute()",{"type":49,"tag":4310,"props":4817,"children":4818},{},[4819,4824,4834],{"type":49,"tag":4332,"props":4820,"children":4821},{},[4822],{"type":63,"value":4823},"Scope tags missing from spans",{"type":49,"tag":4332,"props":4825,"children":4826},{},[4827,4832],{"type":49,"tag":88,"props":4828,"children":4830},{"className":4829},[],[4831],{"type":63,"value":2762},{"type":63,"value":4833}," not applied to streaming spans",{"type":49,"tag":4332,"props":4835,"children":4836},{},[4837,4838],{"type":63,"value":4341},{"type":49,"tag":88,"props":4839,"children":4841},{"className":4840},[],[4842],{"type":63,"value":3180},{"type":49,"tag":4310,"props":4844,"children":4845},{},[4846,4856,4873],{"type":49,"tag":4332,"props":4847,"children":4848},{},[4849,4851],{"type":63,"value":4850},"Custom sampling context not available in ",{"type":49,"tag":88,"props":4852,"children":4854},{"className":4853},[],[4855],{"type":63,"value":1029},{"type":49,"tag":4332,"props":4857,"children":4858},{},[4859,4861,4866,4868],{"type":63,"value":4860},"Set after ",{"type":49,"tag":88,"props":4862,"children":4864},{"className":4863},[],[4865],{"type":63,"value":173},{"type":63,"value":4867}," or before ",{"type":49,"tag":88,"props":4869,"children":4871},{"className":4870},[],[4872],{"type":63,"value":497},{"type":49,"tag":4332,"props":4874,"children":4875},{},[4876,4878,4883,4885],{"type":63,"value":4877},"Set on scope after ",{"type":49,"tag":88,"props":4879,"children":4881},{"className":4880},[],[4882],{"type":63,"value":497},{"type":63,"value":4884}," but before ",{"type":49,"tag":88,"props":4886,"children":4888},{"className":4887},[],[4889],{"type":63,"value":173},{"type":49,"tag":4310,"props":4891,"children":4892},{},[4893,4908,4913],{"type":49,"tag":4332,"props":4894,"children":4895},{},[4896,4901,4903],{"type":49,"tag":88,"props":4897,"children":4899},{"className":4898},[],[4900],{"type":63,"value":2150},{"type":63,"value":4902}," returns wrong type or ",{"type":49,"tag":88,"props":4904,"children":4906},{"className":4905},[],[4907],{"type":63,"value":2737},{"type":49,"tag":4332,"props":4909,"children":4910},{},[4911],{"type":63,"value":4912},"Scope-based span access not reliable in streaming mode",{"type":49,"tag":4332,"props":4914,"children":4915},{},[4916,4917],{"type":63,"value":4341},{"type":49,"tag":88,"props":4918,"children":4920},{"className":4919},[],[4921],{"type":63,"value":2066},{"type":49,"tag":4310,"props":4923,"children":4924},{},[4925,4940,4945],{"type":49,"tag":4332,"props":4926,"children":4927},{},[4928,4933,4934],{"type":49,"tag":88,"props":4929,"children":4931},{"className":4930},[],[4932],{"type":63,"value":4724},{"type":63,"value":4726},{"type":49,"tag":88,"props":4935,"children":4937},{"className":4936},[],[4938],{"type":63,"value":4939},"containing_transaction",{"type":49,"tag":4332,"props":4941,"children":4942},{},[4943],{"type":63,"value":4944},"Attribute removed in streaming mode",{"type":49,"tag":4332,"props":4946,"children":4947},{},[4948,4949],{"type":63,"value":4341},{"type":49,"tag":88,"props":4950,"children":4952},{"className":4951},[],[4953],{"type":63,"value":2330},{"type":49,"tag":4310,"props":4955,"children":4956},{},[4957,4971,4976],{"type":49,"tag":4332,"props":4958,"children":4959},{},[4960,4965,4966],{"type":49,"tag":88,"props":4961,"children":4963},{"className":4962},[],[4964],{"type":63,"value":4724},{"type":63,"value":4726},{"type":49,"tag":88,"props":4967,"children":4969},{"className":4968},[],[4970],{"type":63,"value":907},{"type":49,"tag":4332,"props":4972,"children":4973},{},[4974],{"type":63,"value":4975},"Method removed in streaming mode",{"type":49,"tag":4332,"props":4977,"children":4978},{},[4979,4980,4986,4987,4993,4995],{"type":63,"value":4341},{"type":49,"tag":88,"props":4981,"children":4983},{"className":4982},[],[4984],{"type":63,"value":4985},"span.trace_id",{"type":63,"value":2756},{"type":49,"tag":88,"props":4988,"children":4990},{"className":4989},[],[4991],{"type":63,"value":4992},"span.span_id",{"type":63,"value":4994}," directly, or ",{"type":49,"tag":88,"props":4996,"children":4998},{"className":4997},[],[4999],{"type":63,"value":2634},{"type":49,"tag":4310,"props":5001,"children":5002},{},[5003,5013,5018],{"type":49,"tag":4332,"props":5004,"children":5005},{},[5006,5011],{"type":49,"tag":88,"props":5007,"children":5009},{"className":5008},[],[5010],{"type":63,"value":579},{"type":63,"value":5012}," not called",{"type":49,"tag":4332,"props":5014,"children":5015},{},[5016],{"type":63,"value":5017},"Expected in streaming mode",{"type":49,"tag":4332,"props":5019,"children":5020},{},[5021,5023,5028,5029],{"type":63,"value":5022},"Migrate logic to ",{"type":49,"tag":88,"props":5024,"children":5026},{"className":5025},[],[5027],{"type":63,"value":4260},{"type":63,"value":1023},{"type":49,"tag":88,"props":5030,"children":5032},{"className":5031},[],[5033],{"type":63,"value":3726},{"type":49,"tag":4310,"props":5035,"children":5036},{},[5037,5061,5071],{"type":49,"tag":4332,"props":5038,"children":5039},{},[5040,5042,5047,5049,5054,5056],{"type":63,"value":5041},"Warning: ",{"type":49,"tag":88,"props":5043,"children":5045},{"className":5044},[],[5046],{"type":63,"value":3726},{"type":63,"value":5048}," only works with ",{"type":49,"tag":88,"props":5050,"children":5052},{"className":5051},[],[5053],{"type":63,"value":157},{"type":63,"value":5055}," set to ",{"type":49,"tag":88,"props":5057,"children":5059},{"className":5058},[],[5060],{"type":63,"value":101},{"type":49,"tag":4332,"props":5062,"children":5063},{},[5064,5069],{"type":49,"tag":88,"props":5065,"children":5067},{"className":5066},[],[5068],{"type":63,"value":3726},{"type":63,"value":5070}," set without span streaming enabled",{"type":49,"tag":4332,"props":5072,"children":5073},{},[5074,5076,5081,5083],{"type":63,"value":5075},"Enable streaming with ",{"type":49,"tag":88,"props":5077,"children":5079},{"className":5078},[],[5080],{"type":63,"value":4199},{"type":63,"value":5082},", or remove ",{"type":49,"tag":88,"props":5084,"children":5086},{"className":5085},[],[5087],{"type":63,"value":3726},{"type":49,"tag":4310,"props":5089,"children":5090},{},[5091,5101,5106],{"type":49,"tag":4332,"props":5092,"children":5093},{},[5094,5099],{"type":49,"tag":88,"props":5095,"children":5097},{"className":5096},[],[5098],{"type":63,"value":579},{"type":63,"value":5100}," logic relied on late-set attributes (e.g. status code)",{"type":49,"tag":4332,"props":5102,"children":5103},{},[5104],{"type":63,"value":5105},"These attributes aren't available at span creation time",{"type":49,"tag":4332,"props":5107,"children":5108},{},[5109],{"type":63,"value":5110},"Remove the logic or use server-side filtering (Sentry inbound filters \u002F Relay rules)",{"type":49,"tag":186,"props":5112,"children":5114},{"id":5113},"quick-reference",[5115],{"type":63,"value":5116},"Quick Reference",{"type":49,"tag":1202,"props":5118,"children":5120},{"id":5119},"minimal-setup",[5121],{"type":63,"value":5122},"Minimal Setup",{"type":49,"tag":193,"props":5124,"children":5126},{"className":1054,"code":5125,"language":25,"meta":198,"style":198},"import sentry_sdk\n\nsentry_sdk.init(\n    dsn=\"__DSN__\",\n    traces_sample_rate=1.0,\n    trace_lifecycle=\"stream\",\n)\n",[5127],{"type":49,"tag":88,"props":5128,"children":5129},{"__ignoreMap":198},[5130,5137,5144,5151,5159,5166,5173],{"type":49,"tag":204,"props":5131,"children":5132},{"class":206,"line":207},[5133],{"type":49,"tag":204,"props":5134,"children":5135},{},[5136],{"type":63,"value":1067},{"type":49,"tag":204,"props":5138,"children":5139},{"class":206,"line":217},[5140],{"type":49,"tag":204,"props":5141,"children":5142},{"emptyLinePlaceholder":43},[5143],{"type":63,"value":303},{"type":49,"tag":204,"props":5145,"children":5146},{"class":206,"line":297},[5147],{"type":49,"tag":204,"props":5148,"children":5149},{},[5150],{"type":63,"value":1090},{"type":49,"tag":204,"props":5152,"children":5153},{"class":206,"line":306},[5154],{"type":49,"tag":204,"props":5155,"children":5156},{},[5157],{"type":63,"value":5158},"    dsn=\"__DSN__\",\n",{"type":49,"tag":204,"props":5160,"children":5161},{"class":206,"line":315},[5162],{"type":49,"tag":204,"props":5163,"children":5164},{},[5165],{"type":63,"value":1106},{"type":49,"tag":204,"props":5167,"children":5168},{"class":206,"line":380},[5169],{"type":49,"tag":204,"props":5170,"children":5171},{},[5172],{"type":63,"value":1158},{"type":49,"tag":204,"props":5174,"children":5175},{"class":206,"line":388},[5176],{"type":49,"tag":204,"props":5177,"children":5178},{},[5179],{"type":63,"value":1114},{"type":49,"tag":1202,"props":5181,"children":5183},{"id":5182},"creating-spans",[5184],{"type":63,"value":5185},"Creating Spans",{"type":49,"tag":193,"props":5187,"children":5189},{"className":1054,"code":5188,"language":25,"meta":198,"style":198},"from sentry_sdk.traces import start_span\n\nwith start_span(name=\"my operation\", attributes={\"sentry.op\": \"task\"}) as span:\n    span.set_attribute(\"result.count\", 42)\n",[5190],{"type":49,"tag":88,"props":5191,"children":5192},{"__ignoreMap":198},[5193,5200,5207,5215],{"type":49,"tag":204,"props":5194,"children":5195},{"class":206,"line":207},[5196],{"type":49,"tag":204,"props":5197,"children":5198},{},[5199],{"type":63,"value":1351},{"type":49,"tag":204,"props":5201,"children":5202},{"class":206,"line":217},[5203],{"type":49,"tag":204,"props":5204,"children":5205},{"emptyLinePlaceholder":43},[5206],{"type":63,"value":303},{"type":49,"tag":204,"props":5208,"children":5209},{"class":206,"line":297},[5210],{"type":49,"tag":204,"props":5211,"children":5212},{},[5213],{"type":63,"value":5214},"with start_span(name=\"my operation\", attributes={\"sentry.op\": \"task\"}) as span:\n",{"type":49,"tag":204,"props":5216,"children":5217},{"class":206,"line":306},[5218],{"type":49,"tag":204,"props":5219,"children":5220},{},[5221],{"type":63,"value":5222},"    span.set_attribute(\"result.count\", 42)\n",{"type":49,"tag":1202,"props":5224,"children":5226},{"id":5225},"migration-checklist",[5227],{"type":63,"value":5228},"Migration Checklist",{"type":49,"tag":133,"props":5230,"children":5233},{"className":5231},[5232],"contains-task-list",[5234,5251,5272,5292,5311,5330,5349,5369,5389,5408,5429,5455,5482,5501,5522,5557,5580,5600,5621,5645,5671,5686,5701],{"type":49,"tag":137,"props":5235,"children":5238},{"className":5236},[5237],"task-list-item",[5239,5244,5246],{"type":49,"tag":5240,"props":5241,"children":5243},"input",{"disabled":43,"type":5242},"checkbox",[],{"type":63,"value":5245}," SDK version is ",{"type":49,"tag":88,"props":5247,"children":5249},{"className":5248},[],[5250],{"type":63,"value":1013},{"type":49,"tag":137,"props":5252,"children":5254},{"className":5253},[5237],[5255,5258,5260,5265,5267],{"type":49,"tag":5240,"props":5256,"children":5257},{"disabled":43,"type":5242},[],{"type":63,"value":5259}," Added top-level ",{"type":49,"tag":88,"props":5261,"children":5263},{"className":5262},[],[5264],{"type":63,"value":4199},{"type":63,"value":5266}," to ",{"type":49,"tag":88,"props":5268,"children":5270},{"className":5269},[],[5271],{"type":63,"value":1049},{"type":49,"tag":137,"props":5273,"children":5275},{"className":5274},[5237],[5276,5279,5280,5285,5287],{"type":49,"tag":5240,"props":5277,"children":5278},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5281,"children":5283},{"className":5282},[],[5284],{"type":63,"value":1220},{"type":63,"value":5286}," migrated to ",{"type":49,"tag":88,"props":5288,"children":5290},{"className":5289},[],[5291],{"type":63,"value":1228},{"type":49,"tag":137,"props":5293,"children":5295},{"className":5294},[5237],[5296,5299,5300,5305,5306],{"type":49,"tag":5240,"props":5297,"children":5298},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5301,"children":5303},{"className":5302},[],[5304],{"type":63,"value":1555},{"type":63,"value":5286},{"type":49,"tag":88,"props":5307,"children":5309},{"className":5308},[],[5310],{"type":63,"value":1228},{"type":49,"tag":137,"props":5312,"children":5314},{"className":5313},[5237],[5315,5318,5319,5324,5325],{"type":49,"tag":5240,"props":5316,"children":5317},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5320,"children":5322},{"className":5321},[],[5323],{"type":63,"value":1665},{"type":63,"value":5286},{"type":49,"tag":88,"props":5326,"children":5328},{"className":5327},[],[5329],{"type":63,"value":1228},{"type":49,"tag":137,"props":5331,"children":5333},{"className":5332},[5237],[5334,5337,5338,5343,5344],{"type":49,"tag":5240,"props":5335,"children":5336},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5339,"children":5341},{"className":5340},[],[5342],{"type":63,"value":2059},{"type":63,"value":5286},{"type":49,"tag":88,"props":5345,"children":5347},{"className":5346},[],[5348],{"type":63,"value":2066},{"type":49,"tag":137,"props":5350,"children":5352},{"className":5351},[5237],[5353,5356,5357,5362,5364],{"type":49,"tag":5240,"props":5354,"children":5355},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5358,"children":5360},{"className":5359},[],[5361],{"type":63,"value":2150},{"type":63,"value":5363}," replaced with ",{"type":49,"tag":88,"props":5365,"children":5367},{"className":5366},[],[5368],{"type":63,"value":2066},{"type":49,"tag":137,"props":5370,"children":5372},{"className":5371},[5237],[5373,5376,5377,5382,5383],{"type":49,"tag":5240,"props":5374,"children":5375},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5378,"children":5380},{"className":5379},[],[5381],{"type":63,"value":2157},{"type":63,"value":5363},{"type":49,"tag":88,"props":5384,"children":5386},{"className":5385},[],[5387],{"type":63,"value":5388},"sentry_sdk.traces.get_current_span()._segment",{"type":49,"tag":137,"props":5390,"children":5392},{"className":5391},[5237],[5393,5396,5397,5402,5403],{"type":49,"tag":5240,"props":5394,"children":5395},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5398,"children":5400},{"className":5399},[],[5401],{"type":63,"value":2314},{"type":63,"value":5363},{"type":49,"tag":88,"props":5404,"children":5406},{"className":5405},[],[5407],{"type":63,"value":2330},{"type":49,"tag":137,"props":5409,"children":5411},{"className":5410},[5237],[5412,5415,5416,5422,5423],{"type":49,"tag":5240,"props":5413,"children":5414},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5417,"children":5419},{"className":5418},[],[5420],{"type":63,"value":5421},"@sentry_sdk.trace",{"type":63,"value":5286},{"type":49,"tag":88,"props":5424,"children":5426},{"className":5425},[],[5427],{"type":63,"value":5428},"@sentry_sdk.traces.trace",{"type":49,"tag":137,"props":5430,"children":5432},{"className":5431},[5237],[5433,5436,5437,5442,5443,5448,5450],{"type":49,"tag":5240,"props":5434,"children":5435},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5438,"children":5440},{"className":5439},[],[5441],{"type":63,"value":2386},{"type":63,"value":2756},{"type":49,"tag":88,"props":5444,"children":5446},{"className":5445},[],[5447],{"type":63,"value":2393},{"type":63,"value":5449}," class imports replaced with ",{"type":49,"tag":88,"props":5451,"children":5453},{"className":5452},[],[5454],{"type":63,"value":2419},{"type":49,"tag":137,"props":5456,"children":5458},{"className":5457},[5237],[5459,5462,5463,5468,5470,5475,5477],{"type":49,"tag":5240,"props":5460,"children":5461},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5464,"children":5466},{"className":5465},[],[5467],{"type":63,"value":2525},{"type":63,"value":5469}," replaced with direct properties (",{"type":49,"tag":88,"props":5471,"children":5473},{"className":5472},[],[5474],{"type":63,"value":4985},{"type":63,"value":5476},", etc.) or ",{"type":49,"tag":88,"props":5478,"children":5480},{"className":5479},[],[5481],{"type":63,"value":2634},{"type":49,"tag":137,"props":5483,"children":5485},{"className":5484},[5237],[5486,5489,5490,5495,5496],{"type":49,"tag":5240,"props":5487,"children":5488},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5491,"children":5493},{"className":5492},[],[5494],{"type":63,"value":1430},{"type":63,"value":5363},{"type":49,"tag":88,"props":5497,"children":5499},{"className":5498},[],[5500],{"type":63,"value":1368},{"type":49,"tag":137,"props":5502,"children":5504},{"className":5503},[5237],[5505,5508,5509,5514,5515,5520],{"type":49,"tag":5240,"props":5506,"children":5507},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5510,"children":5512},{"className":5511},[],[5513],{"type":63,"value":1445},{"type":63,"value":5363},{"type":49,"tag":88,"props":5516,"children":5518},{"className":5517},[],[5519],{"type":63,"value":1453},{"type":63,"value":5521}," attribute",{"type":49,"tag":137,"props":5523,"children":5525},{"className":5524},[5237],[5526,5529,5530,5536,5537,5543,5544,5550,5551],{"type":49,"tag":5240,"props":5527,"children":5528},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5531,"children":5533},{"className":5532},[],[5534],{"type":63,"value":5535},"set_data()",{"type":63,"value":2756},{"type":49,"tag":88,"props":5538,"children":5540},{"className":5539},[],[5541],{"type":63,"value":5542},"set_tag()",{"type":63,"value":2756},{"type":49,"tag":88,"props":5545,"children":5547},{"className":5546},[],[5548],{"type":63,"value":5549},"set_context()",{"type":63,"value":5363},{"type":49,"tag":88,"props":5552,"children":5554},{"className":5553},[],[5555],{"type":63,"value":5556},"set_attribute()",{"type":49,"tag":137,"props":5558,"children":5560},{"className":5559},[5237],[5561,5564,5566,5571,5573,5578],{"type":49,"tag":5240,"props":5562,"children":5563},{"disabled":43,"type":5242},[],{"type":63,"value":5565}," Scope-level ",{"type":49,"tag":88,"props":5567,"children":5569},{"className":5568},[],[5570],{"type":63,"value":5542},{"type":63,"value":5572}," supplemented with ",{"type":49,"tag":88,"props":5574,"children":5576},{"className":5575},[],[5577],{"type":63,"value":5556},{"type":63,"value":5579}," where needed",{"type":49,"tag":137,"props":5581,"children":5583},{"className":5582},[5237],[5584,5587,5588,5593,5595],{"type":49,"tag":5240,"props":5585,"children":5586},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5589,"children":5591},{"className":5590},[],[5592],{"type":63,"value":497},{"type":63,"value":5594}," migrated to non-context-manager ",{"type":49,"tag":88,"props":5596,"children":5598},{"className":5597},[],[5599],{"type":63,"value":3364},{"type":49,"tag":137,"props":5601,"children":5603},{"className":5602},[5237],[5604,5607,5608,5614,5615],{"type":49,"tag":5240,"props":5605,"children":5606},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5609,"children":5611},{"className":5610},[],[5612],{"type":63,"value":5613},"custom_sampling_context",{"type":63,"value":5286},{"type":49,"tag":88,"props":5616,"children":5618},{"className":5617},[],[5619],{"type":63,"value":5620},"Scope.set_custom_sampling_context()",{"type":49,"tag":137,"props":5622,"children":5624},{"className":5623},[5237],[5625,5628,5630,5635,5637,5643],{"type":49,"tag":5240,"props":5626,"children":5627},{"disabled":43,"type":5242},[],{"type":63,"value":5629}," (If using ",{"type":49,"tag":88,"props":5631,"children":5633},{"className":5632},[],[5634],{"type":63,"value":1029},{"type":63,"value":5636},") Updated to handle new ",{"type":49,"tag":88,"props":5638,"children":5640},{"className":5639},[],[5641],{"type":63,"value":5642},"sampling_context",{"type":63,"value":5644}," shape",{"type":49,"tag":137,"props":5646,"children":5648},{"className":5647},[5237],[5649,5652,5653,5658,5660,5665,5666],{"type":49,"tag":5240,"props":5650,"children":5651},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5654,"children":5656},{"className":5655},[],[5657],{"type":63,"value":579},{"type":63,"value":5659}," logic migrated to ",{"type":49,"tag":88,"props":5661,"children":5663},{"className":5662},[],[5664],{"type":63,"value":4260},{"type":63,"value":1023},{"type":49,"tag":88,"props":5667,"children":5669},{"className":5668},[],[5670],{"type":63,"value":3726},{"type":49,"tag":137,"props":5672,"children":5674},{"className":5673},[5237],[5675,5678,5679,5684],{"type":49,"tag":5240,"props":5676,"children":5677},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5680,"children":5682},{"className":5681},[],[5683],{"type":63,"value":579},{"type":63,"value":5685}," logic that depends on late-set attributes (e.g. HTTP status code) removed or moved to server-side filtering",{"type":49,"tag":137,"props":5687,"children":5689},{"className":5688},[5237],[5690,5693,5694,5699],{"type":49,"tag":5240,"props":5691,"children":5692},{"disabled":43,"type":5242},[],{"type":63,"value":1000},{"type":49,"tag":88,"props":5695,"children":5697},{"className":5696},[],[5698],{"type":63,"value":579},{"type":63,"value":5700}," removed from config",{"type":49,"tag":137,"props":5702,"children":5704},{"className":5703},[5237],[5705,5708],{"type":49,"tag":5240,"props":5706,"children":5707},{"disabled":43,"type":5242},[],{"type":63,"value":5709}," Spans visible in Sentry dashboard",{"type":49,"tag":5711,"props":5712,"children":5713},"style",{},[5714],{"type":63,"value":5715},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5717,"total":5891},[5718,5743,5757,5772,5786,5803,5819,5831,5841,5852,5862,5878],{"slug":5719,"name":5719,"fn":5720,"description":5721,"org":5722,"tags":5723,"stars":5740,"repoUrl":5741,"updatedAt":5742},"xcodebuildmcp","build and test Apple apps with XcodeBuildMCP","Official skill for XcodeBuildMCP. Use when doing iOS\u002FmacOS\u002FwatchOS\u002FtvOS\u002FvisionOS work (build, test, run, debug, log, UI automation).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5724,5727,5730,5733,5734,5737],{"name":5725,"slug":5726,"type":16},"Debugging","debugging",{"name":5728,"slug":5729,"type":16},"iOS","ios",{"name":5731,"slug":5732,"type":16},"macOS","macos",{"name":9,"slug":8,"type":16},{"name":5735,"slug":5736,"type":16},"Testing","testing",{"name":5738,"slug":5739,"type":16},"Xcode","xcode",6176,"https:\u002F\u002Fgithub.com\u002Fgetsentry\u002FXcodeBuildMCP","2026-04-06T18:13:34.8719",{"slug":5744,"name":5744,"fn":5745,"description":5746,"org":5747,"tags":5748,"stars":5740,"repoUrl":5741,"updatedAt":5756},"xcodebuildmcp-cli","build and test Apple apps via CLI","Official skill for the XcodeBuildMCP CLI. Use when doing iOS\u002FmacOS\u002FwatchOS\u002FtvOS\u002FvisionOS work (build, test, run, debug, log, UI automation).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5749,5752,5753,5754,5755],{"name":5750,"slug":5751,"type":16},"CLI","cli",{"name":5728,"slug":5729,"type":16},{"name":5731,"slug":5732,"type":16},{"name":5735,"slug":5736,"type":16},{"name":5738,"slug":5739,"type":16},"2026-04-06T18:13:36.13414",{"slug":5758,"name":5758,"fn":5759,"description":5760,"org":5761,"tags":5762,"stars":5769,"repoUrl":5770,"updatedAt":5771},"agents-md","maintain project instruction files","Creates and maintains concise AGENTS.md and CLAUDE.md project instruction files. Use when asked to create AGENTS.md, update AGENTS.md, maintain agent docs, set up CLAUDE.md, document repository agent conventions, or keep coding-agent instructions minimal and reference-backed.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5763,5766],{"name":5764,"slug":5765,"type":16},"Documentation","documentation",{"name":5767,"slug":5768,"type":16},"Engineering","engineering",861,"https:\u002F\u002Fgithub.com\u002Fgetsentry\u002Fskills","2026-05-15T06:16:29.695991",{"slug":5773,"name":5773,"fn":5774,"description":5775,"org":5776,"tags":5777,"stars":5769,"repoUrl":5770,"updatedAt":5785},"blog-writing-guide","write and review engineering blog posts","Write, review, and improve blog posts for the Sentry engineering blog following Sentry's specific writing standards, voice, and quality bar. Use this skill whenever someone asks to write a blog post, draft a technical article, review blog content, improve a draft, write a product announcement, create an engineering deep-dive, or produce any written content destined for the Sentry blog or developer audience. Also trigger when the user mentions \"blog post,\" \"blog draft,\" \"write-up,\" \"announcement post,\" \"engineering post,\" \"deep dive,\" \"postmortem,\" or asks for help with technical writing for Sentry. Even if the user just says \"help me write about [feature\u002Ftopic]\" — if it sounds like it could become a Sentry blog post, use this skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5778,5781,5782],{"name":5779,"slug":5780,"type":16},"Communications","communications",{"name":9,"slug":8,"type":16},{"name":5783,"slug":5784,"type":16},"Technical Writing","technical-writing","2026-05-15T06:16:33.38217",{"slug":5787,"name":5787,"fn":5788,"description":5789,"org":5790,"tags":5791,"stars":5769,"repoUrl":5770,"updatedAt":5802},"brand-guidelines","write copy following Sentry brand guidelines","Write copy following Sentry brand guidelines. Use when writing UI text, error messages, empty states, onboarding flows, 404 pages, documentation, marketing copy, or any user-facing content. Covers both Plain Speech (default) and Sentry Voice tones.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5792,5795,5798,5799],{"name":5793,"slug":5794,"type":16},"Branding","branding",{"name":5796,"slug":5797,"type":16},"Content Creation","content-creation",{"name":9,"slug":8,"type":16},{"name":5800,"slug":5801,"type":16},"UX Copy","ux-copy","2026-05-15T06:16:22.395707",{"slug":5804,"name":5804,"fn":5805,"description":5806,"org":5807,"tags":5808,"stars":5769,"repoUrl":5770,"updatedAt":5818},"claude-settings-audit","generate Claude Code settings permissions","Analyze a repository to generate recommended Claude Code settings.json permissions. Use when setting up a new project, auditing existing settings, or determining which read-only bash commands to allow. Detects tech stack, build tools, and monorepo structure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5809,5812,5815],{"name":5810,"slug":5811,"type":16},"Claude Code","claude-code",{"name":5813,"slug":5814,"type":16},"Configuration","configuration",{"name":5816,"slug":5817,"type":16},"Security","security","2026-05-15T06:16:44.335977",{"slug":5820,"name":5820,"fn":5821,"description":5822,"org":5823,"tags":5824,"stars":5769,"repoUrl":5770,"updatedAt":5830},"code-review","perform code reviews for Sentry projects","Perform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Covers security, performance, testing, and design review.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5825,5827,5828,5829],{"name":5826,"slug":5820,"type":16},"Code Review",{"name":5767,"slug":5768,"type":16},{"name":18,"slug":19,"type":16},{"name":5816,"slug":5817,"type":16},"2026-05-15T06:16:35.824864",{"slug":5832,"name":5832,"fn":5833,"description":5834,"org":5835,"tags":5836,"stars":5769,"repoUrl":5770,"updatedAt":5840},"code-simplifier","simplify and refine source code","Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to \"simplify code\", \"clean up code\", \"refactor for clarity\", \"improve readability\", or review recently modified code for elegance. Focuses on project-specific best practices.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5837],{"name":5838,"slug":5839,"type":16},"Code Analysis","code-analysis","2026-05-15T06:16:32.127981",{"slug":5842,"name":5842,"fn":5843,"description":5844,"org":5845,"tags":5846,"stars":5769,"repoUrl":5770,"updatedAt":5851},"commit","create commits with Sentry conventions","Use for every request to commit changes or draft a commit message. Creates Sentry-style conventional commits with issue references.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5847,5850],{"name":5848,"slug":5849,"type":16},"Git","git",{"name":9,"slug":8,"type":16},"2026-07-18T05:15:10.723937",{"slug":5853,"name":5853,"fn":5854,"description":5855,"org":5856,"tags":5857,"stars":5769,"repoUrl":5770,"updatedAt":5861},"create-branch","create git branches for Sentry workflows","Create a git branch following Sentry naming conventions. Use when asked to \"create a branch\", \"new branch\", \"start a branch\", \"make a branch\", \"switch to a new branch\", or when starting new work on the default branch.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5858,5859,5860],{"name":5767,"slug":5768,"type":16},{"name":5848,"slug":5849,"type":16},{"name":9,"slug":8,"type":16},"2026-05-15T06:16:39.458431",{"slug":5863,"name":5863,"fn":5864,"description":5865,"org":5866,"tags":5867,"stars":5769,"repoUrl":5770,"updatedAt":5877},"django-access-review","review Django access control and IDOR","Django access control and IDOR security review. Use when reviewing Django views, DRF viewsets, ORM queries, or any Python\u002FDjango code handling user authorization. Trigger keywords: \"IDOR\", \"access control\", \"authorization\", \"Django permissions\", \"object permissions\", \"tenant isolation\", \"broken access\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5868,5871,5872,5875,5876],{"name":5869,"slug":5870,"type":16},"Access Control","access-control",{"name":5838,"slug":5839,"type":16},{"name":5873,"slug":5874,"type":16},"Django","django",{"name":24,"slug":25,"type":16},{"name":5816,"slug":5817,"type":16},"2026-05-15T06:16:43.098698",{"slug":5879,"name":5879,"fn":5880,"description":5881,"org":5882,"tags":5883,"stars":5769,"repoUrl":5770,"updatedAt":5890},"django-perf-review","review and optimize Django performance","Django performance code review. Use when asked to \"review Django performance\", \"find N+1 queries\", \"optimize Django\", \"check queryset performance\", \"database performance\", \"Django ORM issues\", or audit Django code for performance problems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5884,5885,5888,5889],{"name":5826,"slug":5820,"type":16},{"name":5886,"slug":5887,"type":16},"Database","database",{"name":5873,"slug":5874,"type":16},{"name":18,"slug":19,"type":16},"2026-05-15T06:16:24.832813",88,{"items":5893,"total":4161},[5894,5910,5925,5941,5953,5967,5982],{"slug":5895,"name":5895,"fn":5896,"description":5897,"org":5898,"tags":5899,"stars":27,"repoUrl":28,"updatedAt":5909},"sentry-android-sdk","setup Sentry SDK for Android","Full Sentry SDK setup for Android. Use when asked to \"add Sentry to Android\", \"install sentry-android\", \"setup Sentry in Android\", or configure error monitoring, tracing, profiling, session replay, or logging for Android applications. Supports Kotlin and Java codebases.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5900,5903,5904,5905,5908],{"name":5901,"slug":5902,"type":16},"Android","android",{"name":5725,"slug":5726,"type":16},{"name":14,"slug":15,"type":16},{"name":5906,"slug":5907,"type":16},"SDK","sdk",{"name":9,"slug":8,"type":16},"2026-07-12T06:08:32.396344",{"slug":5911,"name":5911,"fn":5912,"description":5913,"org":5914,"tags":5915,"stars":27,"repoUrl":28,"updatedAt":5924},"sentry-browser-sdk","setup Sentry error monitoring for browser applications","Full Sentry SDK setup for browser JavaScript. Use when asked to \"add Sentry to a website\", \"install @sentry\u002Fbrowser\", or configure error monitoring, tracing, session replay, or logging for vanilla JavaScript, jQuery, static sites, or WordPress.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5916,5917,5920,5923],{"name":5725,"slug":5726,"type":16},{"name":5918,"slug":5919,"type":16},"JavaScript","javascript",{"name":5921,"slug":5922,"type":16},"Monitoring","monitoring",{"name":9,"slug":8,"type":16},"2026-07-18T05:47:44.437436",{"slug":5926,"name":5926,"fn":5927,"description":5928,"org":5929,"tags":5930,"stars":27,"repoUrl":28,"updatedAt":5940},"sentry-cloudflare-sdk","setup Sentry monitoring for Cloudflare","Full Sentry SDK setup for Cloudflare Workers and Pages. Use when asked to \"add Sentry to Cloudflare Workers\", \"install @sentry\u002Fcloudflare\", or configure error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers, Pages, Durable Objects, Queues, Workflows, or Hono on Cloudflare.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5931,5934,5937,5938,5939],{"name":5932,"slug":5933,"type":16},"Cloudflare","cloudflare",{"name":5935,"slug":5936,"type":16},"Edge Functions","edge-functions",{"name":5921,"slug":5922,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-11T05:53:25.361175",{"slug":5942,"name":5942,"fn":5943,"description":5944,"org":5945,"tags":5946,"stars":27,"repoUrl":28,"updatedAt":5952},"sentry-cocoa-sdk","integrate Sentry SDK into Apple applications","Full Sentry SDK setup for Apple platforms (iOS, macOS, tvOS, watchOS, visionOS). Use when asked to \"add Sentry to iOS\", \"add Sentry to Swift\", \"install sentry-cocoa\", or configure error monitoring, tracing, profiling, session replay, logging, or metrics for Apple applications. Supports SwiftUI and UIKit.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5947,5948,5949,5950,5951],{"name":5728,"slug":5729,"type":16},{"name":5731,"slug":5732,"type":16},{"name":5921,"slug":5922,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-11T05:52:57.042493",{"slug":5954,"name":5954,"fn":5955,"description":5956,"org":5957,"tags":5958,"stars":27,"repoUrl":28,"updatedAt":5966},"sentry-dotnet-sdk","setup Sentry SDK for .NET","Full Sentry SDK setup for .NET. Use when asked to \"add Sentry to .NET\", \"install Sentry for C#\", or configure error monitoring, tracing, profiling, logging, or crons for ASP.NET Core, MAUI, WPF, WinForms, Blazor, Azure Functions, or any other .NET application.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5959,5962,5963,5964,5965],{"name":5960,"slug":5961,"type":16},".NET","net",{"name":5725,"slug":5726,"type":16},{"name":14,"slug":15,"type":16},{"name":5906,"slug":5907,"type":16},{"name":9,"slug":8,"type":16},"2026-07-12T06:08:33.793148",{"slug":5968,"name":5968,"fn":5969,"description":5970,"org":5971,"tags":5972,"stars":27,"repoUrl":28,"updatedAt":5981},"sentry-elixir-sdk","setup Sentry SDK for Elixir","Full Sentry SDK setup for Elixir. Use when asked to \"add Sentry to Elixir\", \"install sentry for Elixir\", or configure error monitoring, tracing, logging, or crons for Elixir, Phoenix, or Plug applications. Supports Phoenix, Plug, LiveView, Oban, and Quantum.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5973,5976,5979,5980],{"name":5974,"slug":5975,"type":16},"Backend","backend",{"name":5977,"slug":5978,"type":16},"Elixir","elixir",{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-11T05:53:11.69581",{"slug":5983,"name":5983,"fn":5984,"description":5985,"org":5986,"tags":5987,"stars":27,"repoUrl":28,"updatedAt":5994},"sentry-fix-issues","fix production issues with Sentry","Find and fix issues from Sentry using MCP. Use when asked to fix Sentry errors, debug production issues, investigate exceptions, or resolve bugs reported in Sentry. Methodically analyzes stack traces, breadcrumbs, traces, and context to identify root causes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5988,5989,5992,5993],{"name":5725,"slug":5726,"type":16},{"name":5990,"slug":5991,"type":16},"Incident Response","incident-response",{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-07-12T06:08:35.550824"]