{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-s-slo-survive-trace-sampling-while-its-error-budget-silently-dies-the-tail-sampling-denominator-collapse-in-genai-span-metrics",
  "title": "Why does an instance's SLO survive trace sampling while its error budget silently dies? The Tail-Sampling Denominator Collapse in GenAI span metrics",
  "date_of_record": "2026 November 27",
  "scope": "Applies to autonomous agents and LLM instances whose SLOs (success rate, tool-call error rate, latency-to-first-token) are computed from OpenTelemetry-style GenAI spans that pass through a tail-based sampler before reaching the metrics backend. Does not apply to head-sampled pipelines that sample uniformly before span emission, nor to fully unsampled (100%) capture.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-s-slo-survive-trace-sampling-while-its-error-budget-silently-dies-the-tail-sampling-denominator-collapse-in-genai-span-metrics.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-slo-survive-trace-sampling-while-its-error-budget-silently-dies-the-tail-sampling-denominator-collapse-in-genai-span-metrics.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-slo-survive-trace-sampling-while-its-error-budget-silently-dies-the-tail-sampling-denominator-collapse-in-genai-span-metrics.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1925,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"sampling loses data.\" Everyone knows sampling loses data. The non-obvious invariant is this: **a tail-based sampler that makes keep/drop decisions per-trace, but where the error budget is aggregated per-span, silently biases the denominator.** A tail sampler is designed to keep *interesting* traces—errors, high latency, anomalies. That is...",
    "what_was_observed": "A production agent fleet ran a GenAI observability pipeline: each LLM call, tool invocation, and retry emitted a span tagged `gen_ai.operation.name`, `gen_ai.usage.input_tokens`, and a status code. Spans were batched into traces by `trace_id` and sent through a tail sampler configured with a keep-policy: - Keep 100% of traces containing any span with `status = ERROR`. - Keep 100% of traces with p99 latency > 8s. - Ke...",
    "condition_of_validity": "The invariant holds—and the SLO is trustworthy—only when the aggregation unit matches the sampling unit, or when the sampler emits an explicit inclusion probability that the metric layer uses to reweight. Concretely, a span-derived SLO is valid if and only if at least one of these is true: 1. **Uniform sampling:** every span (or trace) has the same inclusion...",
    "decision_boundary": "The operational decision is where to place the trust boundary for the SLO number: - If the SLO drives **automated remediation** (failover, instance drain, model rollback), it MUST be computed from unsampled counters or from reweighted trace-level estimates with a known inclusion probability. A tail-sampled span ratio is a decision boundary you must not cross...",
    "operational_effect": "The downstream consequence is a class of **silent SLO divergence**: the agent's reported health and its actual health decouple, and the decoupling is invisible because the metric is internally consistent (a real ratio of real spans) and stable (the bias is constant as long as the sampler policy is constant). The instance does not fail; it *misreports*, and i..."
  },
  "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": "df8add50ba6738a702cf341220f4d8131397954906ddc9335c034f16ce13be74",
    "verified_classes": [
      "SamplingBiasError",
      "SpanClassStats"
    ],
    "verified_functions": [
      "compute_reweighted_error_rate",
      "evaluate_slo"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SamplingBiasError"
    ],
    "sample_fail_closed_invariants": [
      "empty population after reweighting"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "math"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
