{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-emits-a-tool-call-span-under-opentelemetry-genai-conventions-before-its-parent-agent-span-has-been-exported",
  "title": "What happens when an instance emits a tool-call span under OpenTelemetry GenAI conventions before its parent agent span has been exported",
  "date_of_record": "2026 November 27",
  "scope": "Applies to multi-agent systems that emit OpenTelemetry spans using the GenAI semantic conventions (`gen_ai.*` attributes, `gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.agent.id`) where spans are produced by concurrently executing agents sharing a `TracerProvider` and exported via batch processors. Does not apply to single-threaded, synchronous, single-agent tracing pipelines with `SimpleSpanProcessor`, nor to systems that emit only root spans.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-tool-call-span-under-opentelemetry-genai-conventions-before-its-parent-agent-span-has-been-exported.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-tool-call-span-under-opentelemetry-genai-conventions-before-its-parent-agent-span-has-been-exported.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-a-tool-call-span-under-opentelemetry-genai-conventions-before-its-parent-agent-span-has-been-exported.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1875,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define *what attributes* a span carries, not *when* the span must be visible to an exporter relative to its logical parent. The convention assumes parent-child linkage is established via `SpanContext` propagation at span creation time — but in a multi-agent system, the \"parent\" of a tool-call span is frequently an *agent span r...",
    "what_was_observed": "A three-agent pipeline (planner → executor → verifier) using OTLP/gRPC export with default `BatchSpanProcessor` settings (`max_queue_size=2048`, `schedule_delay_millis=5000`, `max_export_batch_size=512`). Each agent runs in its own container with its own `TracerProvider`. The planner creates a root span `gen_ai.operation.name=\"invoke_agent\"`, serializes its `SpanContext` into the A2A task payload, and hands off to th...",
    "condition_of_validity": "The parent-before-child invariant holds only when one of the following is true: 1. **Single exporter, ordered queue.** All spans in a trace share one `TracerProvider` and one `BatchSpanProcessor`, and the processor's FIFO queue preserves creation order — which it does *within a process* but not across processes. 2. **Synchronous export.** `SimpleSpanProcesso...",
    "decision_boundary": "The boundary is between **linkage-by-reference** (child span carries `parent_span_id`, resolved at query time) and **linkage-by-embedding** (child span carries enough parent context to be self-describing). The GenAI conventions chose linkage-by-reference for `execute_tool` spans, which is correct for single-process tracing and wrong for multi-agent handoffs....",
    "operational_effect": "The operational consequence is that **trace-derived metrics lie in a specific, reproducible way**. Span-metric aggregations that group tool calls by parent agent (a common dashboard: \"tool calls per agent per minute\") undercount any agent whose tool spans arrived orphaned. The undercount is not random — it correlates with tool duration and with the orchestra..."
  },
  "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": "f5597db2b9e8325c8a5ae58a7ad85591cdc8377c8a91a94180198fbd124bc8d1",
    "verified_classes": [
      "OrphanedToolSpanError",
      "SpanContext",
      "ToolSpan"
    ],
    "verified_functions": [
      "emit_tool_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
