{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-level-span-attribute-mask-parent-child-continuity-loss-in-opentelemetry-genai-agent-traces",
  "title": "Why does an instance-level span attribute mask parent-child continuity loss in OpenTelemetry GenAI agent traces",
  "date_of_record": "2026 November 29",
  "scope": "Applies to multi-step agent runtimes that emit OpenTelemetry GenAI spans (`gen_ai.operation.name`, `gen_ai.system`, `gen_ai.usage.*`) with per-instance attributes and propagate context via W3C `traceparent` across tool-call and handoff boundaries. Does not apply to single-shot inference calls with no child spans, nor to runtimes that emit a single flat span per task.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-level-span-attribute-mask-parent-child-continuity-loss-in-opentelemetry-genai-agent-traces.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-level-span-attribute-mask-parent-child-continuity-loss-in-opentelemetry-genai-agent-traces.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-level-span-attribute-mask-parent-child-continuity-loss-in-opentelemetry-genai-agent-traces.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1601,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things a trace can assert about an agent step: **(a)** that the step *executed* under a given instance identity, and **(b)** that the step is *causally descended* from the parent span that spawned it. OpenTelemetry's GenAI semantic conventions make (a) cheap and durable — you stamp `gen_ai.system`, `gen_ai.agent.id`, and resource-level...",
    "what_was_observed": "An orchestrator agent (`agent.orchestrator`, `service.instance.id=orch-7f2`) dispatches a subtask to a worker (`agent.worker`, `service.instance.id=wrk-b19`) over an A2A-style HTTP handoff. The worker executes three tool calls and returns. In the collected trace: - The orchestrator's `gen_ai.chat` span (`span_id=a1`) is present and correct. - The worker's three `gen_ai.tool` spans and its `gen_ai.chat` span are prese...",
    "condition_of_validity": "The instance-attribute view is a valid proxy for execution continuity **only if** the following invariant holds at every handoff and every tool-call boundary: > For any span `S` emitted by agent step `T`, `S.trace_id == parent(T).trace_id` **and** `S.parent_span_id == parent(T).span_id`, where `parent(T)` is the span that causally invoked `T`. This invariant...",
    "decision_boundary": "The boundary is whether your verification path keys on **attributes** or on **topology**. - If your continuity check is `count(spans where service.instance.id=X) > 0`, it will pass on an orphaned trace. Do not use instance-attribute presence as evidence of causal linkage. - If your check is `exists(span where trace_id = root.trace_id and span.gen_ai.operatio...",
    "operational_effect": "Without the topological guardrail, three concrete failures propagate: (1) **eval undercount** — reasoning-chain walkers see truncated chains and score multi-step tasks as single-step, inflating pass rates on tasks that actually failed mid-chain; (2) **auditor divergence** — a verification agent replaying the trace from `trace_id` reconstructs a different cau..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "dad11ae6db6534b5a80a0755b4ccc0067e8a651c3ad846d1dad1269e90d37f61",
    "verified_classes": [
      "TraceContinuityError",
      "SpanRecord"
    ],
    "verified_functions": [
      "assert_continuity"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TraceContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
