Inferensys

Prompt

Error Budget Burn Trace Attribution Prompt

A practical prompt playbook for using Error Budget Burn Trace Attribution Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for attributing error budget burn to specific failure categories during an SLO breach.

This prompt is designed for Site Reliability Engineers (SREs) and FinOps practitioners who are actively responding to a Service Level Objective (SLO) breach. The core job-to-be-done is to rapidly attribute error budget consumption across a set of production traces to specific, actionable failure categories—such as model errors, tool timeouts, refusal spikes, or latency overruns—and rank them by their impact on the error budget. The ideal user has access to a batch of traces from the breach window and needs a structured, evidence-backed report to guide remediation and communicate impact to stakeholders, rather than manually sifting through individual spans.

Use this prompt when you have already isolated a time window and a set of traces associated with a known SLO breach. It is most effective when the input traces contain structured metadata, including span-level error codes, latency measurements, and tool-call outcomes. The prompt requires a clear definition of your error budget rules and failure categories to produce a reliable attribution. Do not use this prompt for real-time alerting, for diagnosing a single failed request in isolation, or when the root cause is already known and does not require a ranked, quantitative breakdown. It is an analytical tool for post-hoc incident scoping, not a replacement for your monitoring dashboards.

Before executing this prompt, ensure your trace data is pre-processed to include the necessary fields: a unique trace ID, a timestamp, a failure classification tag, and a latency value. The prompt's value hinges on the quality of this input data. The output is a burn-down attribution report, which should be treated as a diagnostic aid, not a final verdict. For high-severity incidents, always pair the model's output with human review of the top attributed traces to confirm the failure signatures before communicating the report to stakeholders. The next step after generating this report is to use the ranked attribution to drive a fix-forward or rollback decision, often by feeding the top failure category into a more targeted diagnostic prompt, such as the 'Tool-Call Error Correlation Prompt Across Sessions' or the 'Latency Spike Root-Cause Trace Prompt.'

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use it to attribute error budget burn during an active SLO breach, not for routine cost dashboards or general latency reviews.

01

Good Fit: Active SLO Breach Triage

Use when: an error budget is burning faster than the threshold and you need a ranked attribution of budget consumption across failure categories before the review window closes. Guardrail: feed the prompt only traces that contributed to the burn window; exclude successful requests to keep the attribution focused.

02

Bad Fit: General Cost Dashboards

Avoid when: the goal is a standard cost or latency dashboard. This prompt is designed for incident-time attribution, not ongoing financial reporting. Guardrail: route routine cost queries to a dedicated FinOps prompt; reserve this prompt for SLO breach scenarios.

03

Required Inputs

What you need: a batch of production traces from the burn window, the SLO target and current error budget remaining, and the failure categories to score against (model errors, tool timeouts, refusal spikes, latency overruns). Guardrail: validate that trace timestamps fall within the breach window before running attribution; stale traces produce misleading rankings.

04

Operational Risk: Spurious Correlation

What to watch: the prompt may attribute budget burn to a category that correlates with the incident but is not the root cause—for example, blaming tool timeouts when the real trigger was an upstream model change. Guardrail: always pair the attribution report with a root-cause isolation trace before communicating findings to stakeholders.

05

Operational Risk: Stakeholder Overreaction

What to watch: a ranked burn-down report can trigger premature rollback or infrastructure changes if shared without context. Guardrail: add a human-review flag and a confidence caveat to the output before distribution; require incident commander approval for any remediation action based solely on the attribution report.

06

Variant: Pre-Breach Early Warning

What to watch: teams may want to run this prompt before the SLO is breached to predict which categories will consume the budget. Guardrail: the prompt is calibrated for post-breach attribution; for early warning, use a forecasting variant with trend-weighted scoring and lower confidence thresholds, and clearly label the output as predictive.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for attributing error budget burn to specific failure categories across production traces.

The following prompt template is designed to be copied directly into your observability or incident-response tooling. It accepts a batch of production traces from an SLO breach window and outputs a structured burn-down attribution report. Every placeholder is enclosed in square brackets and must be replaced with real data before execution. The template assumes you have already extracted relevant traces—filtered by the error budget burn period—and have them available in a structured format such as JSON span arrays or log entries.

code
You are an SRE trace analyst. Your task is to attribute error budget consumption across a set of production traces to specific failure categories and rank them by budget impact.

[INPUT]
A batch of production traces from the SLO breach window. Each trace includes:
- trace_id
- spans with operation_name, service, duration_ms, status (OK/ERROR), error_message
- model_request and model_response payloads where applicable
- tool_call records with tool_name, arguments, response, and duration_ms
- refusal flags and safety filter activations
- latency breakdowns (model_inference_ms, tool_call_ms, retrieval_ms, overhead_ms)
- timestamp

[CONSTRAINTS]
1. Classify each trace into exactly one primary failure category from the list below.
2. If a trace matches multiple categories, choose the most impactful (highest latency contribution or error severity).
3. Ignore traces where status is OK and latency is within SLO threshold.
4. For each category, compute:
   - trace_count: number of traces in that category
   - total_budget_burn_seconds: sum of latency over SLO threshold across those traces
   - budget_burn_percentage: percentage of total error budget consumed by this category
   - top_contributing_trace_ids: up to 5 trace IDs with the highest individual burn
   - representative_error_message: the most common error message or failure signature
5. Flag any trace where the failure cause is ambiguous with `human_review_required: true`.

[FAILURE_CATEGORIES]
- MODEL_ERROR: model returned an error, hallucinated critical fields, or produced unparseable output
- TOOL_TIMEOUT: a tool call exceeded its timeout and caused request failure or severe latency
- REFUSAL_SPIKE: model refused to answer a valid request, triggering fallback or error
- LATENCY_OVERRUN: model or tool latency exceeded SLO threshold without an explicit error
- CONTEXT_OVERFLOW: context window overflow caused evidence loss or degraded output
- RETRIEVAL_FAILURE: vector store or search returned empty, irrelevant, or error responses
- INFRA_ERROR: DNS, network, OOM, or dependency service failure
- PROMPT_REGRESSION: output format drift, instruction violation, or behavioral change from prior version
- UNKNOWN: failure does not match any above category (requires human review)

[OUTPUT_SCHEMA]
{
  "report": {
    "breach_window": {
      "start": "ISO timestamp",
      "end": "ISO timestamp",
      "total_traces_analyzed": int,
      "total_budget_burn_seconds": float,
      "slo_threshold_ms": int
    },
    "attribution": [
      {
        "rank": int,
        "category": "FAILURE_CATEGORY",
        "trace_count": int,
        "total_budget_burn_seconds": float,
        "budget_burn_percentage": float,
        "top_contributing_trace_ids": ["trace_id", ...],
        "representative_error_message": "string",
        "human_review_required": boolean
      }
    ],
    "ambiguous_traces": [
      {
        "trace_id": "string",
        "possible_categories": ["CATEGORY", ...],
        "reason": "string explaining ambiguity"
      }
    ],
    "summary": "One-paragraph narrative summarizing the primary budget burn driver and recommended next step."
  }
}

[EXAMPLES]
Example input trace (abbreviated):
{
  "trace_id": "abc123",
  "spans": [
    {"operation_name": "tool_call/search", "status": "ERROR", "error_message": "timeout after 5000ms", "duration_ms": 5100}
  ],
  "latency_breakdown": {"tool_call_ms": 5100, "model_inference_ms": 200}
}
Expected classification: TOOL_TIMEOUT

Example input trace (abbreviated):
{
  "trace_id": "def456",
  "spans": [
    {"operation_name": "model_inference", "status": "OK", "duration_ms": 8000}
  ],
  "latency_breakdown": {"model_inference_ms": 8000},
  "slo_threshold_ms": 5000
}
Expected classification: LATENCY_OVERRUN

[RISK_LEVEL]
HIGH. This prompt informs incident response and stakeholder communication. Incorrect attribution can lead to misdirected remediation efforts. Always review ambiguous traces manually before finalizing the report.

To adapt this template, replace [INPUT] with your actual trace data formatted as specified. If your trace schema differs, update the field descriptions in the input block and adjust the [OUTPUT_SCHEMA] to match your internal reporting format. The failure categories in [CONSTRAINTS] should be customized to your system's known failure modes—add or remove categories based on your service architecture. For teams using OpenTelemetry, map operation_name to your span names and status to OTel status codes. Before running this prompt in an incident, test it against a labeled set of historical traces to verify classification accuracy and budget-burn arithmetic. The human_review_required flag is critical: never automate the final report without reviewing ambiguous traces, especially when the error budget burn is severe and stakeholders are waiting for a root-cause summary.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Error Budget Burn Trace Attribution Prompt. Each variable must be populated before the prompt can produce a reliable burn-down attribution report.

PlaceholderPurposeExampleValidation Notes

[SLO_WINDOW]

The time range of the SLO breach being investigated

2025-01-15T00:00:00Z to 2025-01-15T23:59:59Z

Must be ISO 8601 range. Reject if start > end. Required.

[ERROR_BUDGET_TOTAL]

Total error budget in minutes or request count for the window

45 minutes

Must be numeric with unit. Reject if zero or negative. Required.

[ERROR_BUDGET_CONSUMED]

Amount of error budget already consumed in the window

52 minutes

Must be numeric with unit. Flag if consumed > total for human review. Required.

[TRACE_BATCH]

Array of production traces with spans, error codes, latencies, and tool-call metadata

[{trace_id, spans: [{operation, latency_ms, error_code, tool_name}]}]

Must be valid JSON array. Reject if empty. Each trace must have trace_id and spans. Required.

[FAILURE_CATEGORIES]

Taxonomy of failure categories to attribute budget burn against

["model_error", "tool_timeout", "refusal_spike", "latency_overrun"]

Must be non-empty array of strings. Validate against known category enum. Required.

[BUDGET_UNIT]

Unit of error budget measurement

"minutes" or "requests"

Must match unit in ERROR_BUDGET_TOTAL and ERROR_BUDGET_CONSUMED. Reject on mismatch. Required.

[CONFIDENCE_THRESHOLD]

Minimum confidence score for attribution before flagging for human review

0.85

Must be float between 0.0 and 1.0. Default 0.85 if not provided. Optional.

[STAKEHOLDER_AUDIENCE]

Target audience for the output report to adjust language and detail level

"incident_review" or "executive_summary"

Must be one of allowed enum values. Default "incident_review". Optional.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Error Budget Burn Trace Attribution Prompt into an incident-response or FinOps workflow with validation, retries, and stakeholder-ready output.

This prompt is designed to run during an active SLO breach or a scheduled error-budget review. It expects a batch of production traces—typically pulled from your observability platform (Datadog, Honeycomb, LangSmith, etc.)—along with the current error budget status and the SLO window definition. The output is a structured burn-down attribution report, not a raw trace dump, so the harness must enforce the output schema before the report reaches an incident commander or FinOps stakeholder.

Wire the prompt into an incident-response runbook or a scheduled FinOps pipeline. At invocation time, assemble the [TRACE_BATCH] by querying your trace store for all requests within the SLO window that consumed error budget (e.g., HTTP 5xx, timeout, refusal, or custom failure signals). Include span-level detail: model name, tool calls, latency per span, error codes, and prompt version tags. Populate [SLO_CONTEXT] with the current budget remaining, the burn rate, the window duration, and the threshold that triggered the alert. Set [FAILURE_CATEGORIES] to your organization's taxonomy—model errors, tool timeouts, refusal spikes, latency overruns, context overflows—and map each trace span to a category before calling the prompt. If your trace store doesn't natively tag categories, run a lightweight classification step first or pass raw spans and let the prompt classify them. The [OUTPUT_SCHEMA] should enforce a ranked list of categories with budget-consumed percentages, exemplar trace IDs, and a confidence score per attribution. Validate the output against this schema immediately after generation; reject and retry if the JSON is malformed, if percentages don't sum to within 1% of the total budget consumed, or if any category lacks at least one supporting trace ID.

Model choice matters here. Use a model with strong structured-output capabilities and a context window large enough to hold your trace batch. For incidents involving more than 50 traces, consider pre-aggregating spans into per-category summaries before calling the prompt, or split the batch and merge results with a second synthesis call. Log every invocation: input trace IDs, the generated attribution report, the validator result, and any retries. This audit trail is essential for postmortem review and for defending budget-attribution decisions to stakeholders. If the prompt's confidence score for any top category falls below your threshold (e.g., 0.7), flag the report for human review before distribution. Never send an unvalidated attribution report to an incident channel or executive summary—misattributed budget burn can drive the wrong remediation and erode trust in your observability pipeline.

For recurring FinOps use, schedule this prompt to run at the end of each SLO window and store the output in a time-series database alongside your budget metrics. This lets you track category trends over time and detect slow-burn regressions that don't trigger a single-incident alert. When wiring into an incident runbook, make the prompt call blocking: the incident commander should not close the incident until the attribution report is validated and reviewed. If the prompt fails after three retries, escalate to the AI SRE on-call with the raw trace batch and the validator error log. Avoid running this prompt on traces that haven't been deduplicated—duplicate spans will inflate budget-consumed percentages and corrupt the ranking.

IMPLEMENTATION TABLE

Expected Output Contract

Validation rules for the burn-down attribution report. Each field must pass these checks before the output is accepted by downstream incident review or stakeholder communication systems.

Field or ElementType or FormatRequiredValidation Rule

attribution_report

JSON object

Top-level object must parse as valid JSON. Schema validation required before ingestion.

report_metadata.generated_at

ISO-8601 timestamp

Must be within 5 minutes of trace data window. Reject if stale.

report_metadata.incident_id

string

Must match [INCIDENT_ID] input exactly. Case-sensitive match required.

budget_summary.total_budget_consumed_pct

number (0-100)

Must be a float between 0 and 100. Negative values or values over 100 trigger a retry.

failure_categories

array of objects

Array must contain at least 1 entry. Empty array triggers a retry with explicit instruction.

failure_categories[].category

enum string

Must match one of: model_error, tool_timeout, refusal_spike, latency_overrun, context_overflow, unknown. Unknown category requires human-review flag.

failure_categories[].budget_consumed_pct

number (0-100)

Sum of all category budget_consumed_pct values must equal total_budget_consumed_pct within 0.1 tolerance. Mismatch triggers a repair retry.

failure_categories[].trace_ids

array of strings

Each trace_id must appear in the input [TRACES] array. Orphan trace_ids trigger a citation check and removal.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when attributing error budget burn to traces and how to prevent misattribution.

01

Spurious Correlation with Low-Volume Signals

What to watch: The prompt attributes budget burn to a failure category that appears in only a handful of traces, creating a false sense of root cause. Low-frequency errors can coincidentally align with the burn window. Guardrail: Require a minimum trace count threshold per category before ranking it as a contributor. Flag categories below the threshold as 'insufficient data' rather than excluding them silently.

02

Double-Counting Across Overlapping Categories

What to watch: A single trace exhibiting both a tool timeout and a latency overrun gets counted in both categories, inflating the total attributed burn beyond 100% of the actual budget consumed. Guardrail: Implement a primary-failure classification rule that assigns each trace to exactly one dominant category based on the first failure event or the largest latency contributor. Report overlap as a secondary metric.

03

Ignoring Baseline Error Rates

What to watch: The prompt treats all errors as incident-related burn, failing to subtract the steady-state background error rate that existed before the SLO breach. This overstates the incident's impact. Guardrail: Require a baseline comparison window as input. The prompt must compute delta burn—the difference between incident-window error budget consumption and the same-duration baseline window—before ranking categories.

04

Category Definitions Drift Across Runs

What to watch: Without strict category definitions, the model classifies the same trace as 'model error' in one run and 'refusal spike' in another, making incident-to-incident comparisons unreliable. Guardrail: Provide a fixed taxonomy of failure categories with explicit inclusion and exclusion criteria in the prompt. Include few-shot examples of boundary cases. Validate category consistency across multiple runs on a holdout set.

05

Missing Trace Context Causes Misclassification

What to watch: The prompt receives truncated traces missing tool-call spans, latency breakdowns, or error messages. It fills gaps with plausible but incorrect classifications, undermining stakeholder trust. Guardrail: Require a trace completeness check before attribution. The prompt must flag traces with missing spans or incomplete error metadata and either exclude them or label attributions as 'low confidence.' Surface completeness stats in the output.

06

Stakeholder Misinterpretation of Burn-Down Rankings

What to watch: The output ranks categories by budget impact, but readers interpret the top-ranked category as the root cause rather than the largest symptom. A tool timeout spike may be caused by an upstream infrastructure failure, not a tool defect. Guardrail: Include a causal caveat section in the output schema. The prompt must distinguish between 'largest budget consumer' and 'likely root cause,' and recommend follow-on trace correlation for causal confirmation.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Error Budget Burn Trace Attribution Prompt before deploying it into an incident response or SLO review workflow. Each criterion targets a specific failure mode that would undermine stakeholder trust or delay incident resolution.

CriterionPass StandardFailure SignalTest Method

Budget Consumption Accuracy

Sum of attributed burn percentages across all categories equals 100% (±1%) of the total error budget consumed in the trace window.

Attribution percentages sum to less than 90% or more than 110%, indicating unaccounted budget consumption or double-counting.

Parse the output JSON, extract all budget_consumed_pct values, and assert that the total is between 99 and 101.

Category Completeness

Every trace in the input batch is assigned to exactly one failure category. No trace is left uncategorized or assigned to an 'Other' bucket exceeding 10% of total traces.

More than 10% of traces fall into an 'Other' or 'Uncategorized' bucket, or a single trace appears in multiple categories without a clear primary assignment.

Count traces per category from the output. Verify that the sum of trace counts equals the input batch size and that 'Other' count is below the threshold.

Evidence Traceability

Each category in the burn-down report cites at least one specific trace ID and span ID as supporting evidence.

A category appears with a budget impact claim but no trace ID or span ID reference, making the attribution unverifiable.

Scan each category object for a non-empty evidence_trace_ids array. Fail if any category with budget_consumed_pct > 0 has an empty evidence list.

Ranking Correctness

Categories are ordered by budget impact in descending order. The top-ranked category has the highest budget_consumed_pct.

A lower-impact category appears above a higher-impact one, or the ranking is alphabetical rather than quantitative.

Extract the ordered list of budget_consumed_pct values. Assert that the sequence is monotonically decreasing.

Latency vs. Error Separation

Latency overruns and model errors are reported as distinct categories with separate budget attribution, not conflated into a single 'Performance' bucket.

The output contains a single 'Performance' or 'Other Failure' category that merges timeout errors with model refusal errors.

Check that the output contains at least two distinct category names among: 'Model Error', 'Tool Timeout', 'Latency Overrun', 'Refusal Spike'. Fail if only one performance-related category exists.

Stakeholder Summary Readability

The executive_summary field contains no more than 150 words, names the top two budget-consuming categories, and states the total budget burned as a percentage of the SLO window.

The summary exceeds 200 words, omits the total burn percentage, or uses raw trace jargon without translation for a non-engineering audience.

Count words in the executive_summary string. Assert word count ≤ 150. Assert presence of a percentage value and at least one named failure category.

Human-Review Flag for Ambiguous Cases

Traces where the failure cause cannot be confidently attributed to a single category are flagged with requires_human_review: true and excluded from automated attribution.

Ambiguous traces are silently assigned to a category without a confidence indicator, or the output contains no requires_human_review field at all.

Check that the output schema includes a requires_human_review boolean for each trace or category. Fail if the field is absent or if all traces have requires_human_review: false when the input contains mixed failure signals.

Output Schema Compliance

The output is valid JSON matching the declared [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys.

The output is missing required fields such as categories, total_budget_burned_pct, or executive_summary, or contains unexpected keys that break downstream parsing.

Validate the output against the [OUTPUT_SCHEMA] using a JSON schema validator. Fail on missing required fields or additional properties not defined in the schema.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a small batch of 5-10 traces and manual review. Replace [SLO_TARGET] with a fixed threshold and [TIME_WINDOW] with a recent incident window. Skip strict schema validation initially—focus on whether the attribution categories match your observability data.

Watch for

  • Categories that don't match your actual trace spans (e.g., 'tool_timeout' vs 'api_error')
  • Over-attribution to a single category when multiple failures co-occur
  • Missing budget impact calculations if your SLO uses a different unit than the prompt assumes
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.