{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-span-parenting-loss-in-genai-observability-exporters-during-agentic-trace-topology-reconstruction",
  "title": "What structural signals indicate span-parenting loss in GenAI observability exporters during agentic trace topology reconstruction",
  "date_of_record": "2026 November 30",
  "scope": "Applies to OpenTelemetry-style GenAI span exporters that emit agent execution traces (LLM calls, tool invocations, sub-agent handoffs) where parent-child relationships are reconstructed downstream from span attributes rather than preserved by an in-process trace context. Does not apply to single-process synchronous agents whose spans are emitted with a live `SpanContext` object held in memory for the trace's full lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-loss-in-genai-observability-exporters-during-agentic-trace-topology-reconstruction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-loss-in-genai-observability-exporters-during-agentic-trace-topology-reconstruction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-loss-in-genai-observability-exporters-during-agentic-trace-topology-reconstruction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1850,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing spans.\" It is *orphaned spans that pass schema validation while silently re-rooting the topology*. A GenAI exporter that batches spans for async flush, serializes them to JSON, and hands them to a collector is subject to a specific class of defect: the `parentSpanId` field is present and syntactically valid (a 16-hex-char string),...",
    "what_was_observed": "A three-tier agent (orchestrator → planner sub-agent → tool-calling executor) emitting spans via an OTLP exporter with a 512-span batch limit and a 5-second `scheduledDelayMillis`. The orchestrator's root span was long-lived (held open across the full task, ~40s). Sub-agent spans and tool spans completed and were flushed in intermediate batches. Under load, three structural signals appeared in the reconstructed trace...",
    "condition_of_validity": "The invariant — *one root per agent invocation, and the root is the span whose `agent.role` is the entry role* — holds only when all of the following are true: - The exporter preserves `traceId` across batch boundaries and retries for the lifetime of a single agent invocation. Trace ID must be bound at invocation start, not at flush time. - The exporter's fl...",
    "decision_boundary": "The boundary for treating a reconstruction as trustworthy versus quarantining it: - **Trust** when: exactly one null-parent span per `traceId`; that span's `agent.role` matches the invocation's declared entry role; every non-root span's `parentSpanId` resolves to an emitted span in the same `traceId`; no duplicate `(traceId, spanId)` pairs with divergent `pa...",
    "operational_effect": "Concretely, an agentic system that skips this check will: - Under-report sub-agent cost on the orchestrator's critical path, because detached subtrees are attributed to their spurious roots. In the observed case, 12s of the 40s critical path (30%) vanished from orchestrator attribution. - Over-count root spans in dashboards, inflating \"agent invocations\" by ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "bbedfacf1abdfabd4f4e14e36cea58824766971356daa6318dbfdf403437a570",
    "verified_classes": [
      "TraceTopologyConformanceError",
      "Span"
    ],
    "verified_functions": [
      "assert_topology_conformant"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TraceTopologyConformanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
