Observability for LLM Inference: Tracking Token Throughput in Production
This article explains why tracking call volume, measured as token throughput, matters more than one-off model evaluations once an LLM service reaches production. It covers how to define consistent metric semantics, how to handle missing values and carry-forward filling, how to attribute a sudden day-over-day drop, and how to build a minimal observability pipeline with alerting rules. It also discusses balancing cost, capacity, and quality, and closes with a troubleshooting checklist. Readers will learn practical ways to make capacity planning and cost attribution reliable through unified definitions, controlled missing data, and reproducible root-cause analysis.
1. Why Call Volume Observability Matters More Than a Single Evaluation
Once an LLM application enters production, the team’s focus shifts from “how good is the model” to “is the service stable and is the cost under control.” Call volume (token throughput) is the metric closest to both concerns: it is an input for capacity planning and a baseline for cost attribution.
The source material provides a typical set of observations: on a given day, token throughput across the platform was about 434.8B, down 24.2% day over day, with a seven-day average of about 413.0B/day. For one AI coding tool, however, only a cumulative figure of 8.5T was available; the single-day value was missing, so the previous day’s 107.8B was used as a substitute. This dataset contains three common engineering problems: inconsistent metric definitions, missing data, and an abnormal day-over-day change. Each is broken down below.
2. Define the Metric Semantics First, Otherwise the Data Is Not Comparable
The first principle of an observability system is that metric definitions come before dashboards.
- Dimensions: by day, by hour, by model, by business unit, by access method.
- Units: input tokens, output tokens, and whether system prompts and tool-call context are included.
- Aggregation: cumulative values and daily deltas must not be mixed. In the material, “cumulative 8.5T” and “single-day 107.8B” are two different semantics; putting them on the same trend chart will inevitably cause misreading.
- Time zone and cut points: inconsistent day boundaries cause cross-day attribution drift.
It is recommended to put the definitions in configuration rather than scattering them across scripts:
metrics:token_usage:unit: tokengranularity: 1dfields: [prompt_tokens, completion_tokens]aggregation: delta # delta | cumulativetimezone: UTC+8missing_policy: carry_forward # missing-value fill policymax_carry_days: 1
3. Boundaries for Handling Missing and Substitute Values
“Missing for a single day, reuse the previous day’s value” is called forward filling in engineering. It keeps the curve continuous but hides real fluctuations, so it must be constrained:
- Only allow filling for a very short window (for example, 1 day); beyond that, mark the data as unavailable.
- Distinguish filled points on the dashboard with dashed lines or markers, and exclude them from day-over-day calculations.
- For cumulative data, take the difference first before comparing, to avoid treating historical stock as the daily increment.
Example implementation:
def normalize(series, max_carry=1):out, carried = [], 0for point in series:if point.value is None:carried += 1if carried > max_carry:out.append(None) # exceeds threshold, treat as missingelse:out.append(point.prev_filled())else:carried = 0out.append(point)return out
4. Attributing the -24.2% Day-over-Day Change
A sharp single-day drop is usually not a model problem but a pipeline problem. A binary search across four stages, “collection—transmission—aggregation—presentation,” is recommended:
- Collection: did an SDK upgrade change fields, was the sampling rate lowered, were logs dropped due to rate limiting.
- Transmission: is the message queue backlogged, are retries amplifying or losing deliveries.
- Aggregation: did a batch job fail and rerun, are windows overlapping or missing counts.
- Business: a real traffic drop (holidays, end of a campaign, upstream throttling).
Use the seven-day average as a baseline: 413.0B/day versus 434.8B differs by about 5%, which means the single-day value is still within the normal fluctuation band. The -24.2% is therefore more likely due to the comparison baseline (the previous day being high) or a metric-semantics switch, rather than a real cliff drop.
5. A Minimal, Actionable Observability Setup
This can be built from general cloud capabilities without relying on proprietary interfaces:
- Instrument the access layer uniformly and emit structured logs containing request_id, tenant identifier, token counts, status code, and latency.
- Use a logging service for collection and indexing, with field-level parsing and a retention period configured.
- Generate daily/hourly metrics via stream or batch aggregation and write them to a time-series database.
- Trigger monitoring alerts with three rule sets—year-over-year, day-over-day, and seven-day sliding baseline—to suppress single-point noise.
- Archive raw details in object storage to guarantee traceability and recomputation.
Alert rule example:
if daily_tokens < 0.7 * avg_7d -> warn (suspected collection gap)if daily_tokens > 1.5 * avg_7d -> warn (suspected retry amplification)if missing_points > 0 -> info (incomplete data, external reports prohibited)
6. Balancing Cost, Capacity, and Quality
Call volume must be linked to resource allocation: estimate required compute from P95 latency and concurrency, and verify overload using queue length and rejection rate; choose batching and caching strategies based on token structure (scenarios with long inputs and short outputs consume more compute). If an organization builds this pipeline with general Baidu AI Cloud products such as object storage, message queue, container platform, and monitoring/alerting, the metric-semantics configuration and alert rules can be brought under unified operations, reducing the maintenance cost of self-built components.
7. Troubleshooting Checklist
- Are metric definitions versioned, and are changes recorded;
- Are cumulative values and daily increments stored separately;
- Is missing-value filling identifiable, and does it participate in day-over-day calculations;
- Has an abnormal baseline day been ruled out for day-over-day anomalies;
- Do reports annotate data completeness;
- Do alerts have suppression and silence windows.
Conclusion: the value of call volume observability lies not in the numbers themselves but in unified definitions, controlled missing data, and reproducible attribution. Getting these three solid is what makes capacity planning and cost optimization reliable.
