{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-emits-opentelemetry-genai-spans-without-a-stable-agent-instance-identity-and-cost-telemetry-detaches-from-the-trace-that",
  "title": "What happens when an instance emits OpenTelemetry GenAI spans without a stable agent-instance identity, and cost telemetry detaches from the trace that incurred it",
  "date_of_record": "2026 November 23",
  "scope": "Applies to LLM agent runtimes that emit spans conforming to the OpenTelemetry GenAI semantic conventions (`gen_ai.*` attributes) across multi-step, multi-tool, potentially multi-instance executions, where token usage and cost are attributed per span. Does not apply to single-shot inference calls with no tool loop, nor to runtimes that emit a single monolithic span per task with no child tool spans.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-opentelemetry-genai-spans-without-a-stable-agent-instance-identity-and-cost-telemetry-detaches-from-the-trace-that.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-opentelemetry-genai-spans-without-a-stable-agent-instance-identity-and-cost-telemetry-detaches-from-the-trace-that.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-opentelemetry-genai-spans-without-a-stable-agent-instance-identity-and-cost-telemetry-detaches-from-the-trace-that.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1725,
    "python_slice_tokens": 325,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define attribute *names* and *value shapes* — `gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.tool.name`, `gen_ai.agent.name` — but they do not define a *binding* between a span and the concrete agent instance that produced it, nor do they mandate that usage at...",
    "what_was_observed": "A planner agent (`gen_ai.agent.name=planner`) spawned three worker sub-agents per task. Each worker emitted a root span with `gen_ai.operation.name=chat` and child spans for tool calls carrying `gen_ai.tool.name` and per-call `gen_ai.usage.*_tokens`. The runtime used a per-process `service.instance.id` resource attribute, but workers were executed in ephemeral sandbox processes that were recycled every ~90 seconds. T...",
    "condition_of_validity": "The invariant that must hold for cost telemetry to be trustworthy is: > For any task execution, the set of spans carrying `gen_ai.usage.*` attributes attributable to that execution must be (a) closed under the parent-child relation — every usage-bearing span has an ancestor root span in the same trace — and (b) bound to a resource identity that is stable for...",
    "decision_boundary": "The boundary is whether a usage-bearing span can be *reached* from a task-scoped root by parent-child traversal, and whether its resource identity is *stable across the execution's lifetime*. Concretely: - If a retry or resume emits a new root span → the boundary is crossed; cost is undercounted by the orphaned generation tokens and the orphan is likely drop...",
    "operational_effect": "Without the guardrail, cost dashboards are *plausible but wrong*: aggregates look healthy, per-trace cost is systematically low by the retry-waste fraction, and per-instance cost is inflated or deflated by id recycling. Runaway detection keyed on per-instance token rate produces false positives on merged instances and false negatives on split ones — the exac..."
  },
  "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": "5f492bb89e5c1a7bd5ed66cc1e88d63da2d4bdaa5803bd785a3b4ddf929a789e",
    "verified_classes": [
      "TelemetryAttributionError",
      "GenAISpan",
      "ExecutionRegistry"
    ],
    "verified_functions": [
      "validate_usage_span",
      "instance_is_execution_scoped"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TelemetryAttributionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
