Shift Log: AI Latency and Error Monitoring Verdicts
The shift starts with a familiar report: AI responses feel slow, but the request dashboard looks healthy. Three monitoring approaches compete for attention: SDK logs, application traces, and metrics collected at the API boundary. They answer different questions. For this head-to-head, the deciding tests are whether each approach explains user-visible latency, exposes failures hidden by retries, and supports a useful incident handoff.
SDK logs win the first investigation, not the latency verdict
SDK logs are the quickest place to inspect request parameters, response codes, exceptions, and provider request identifiers when available. They help establish whether a call failed because of authentication, rate limiting, a timeout, or an upstream error. Keep credentials and sensitive prompt content out of routine logs.
The weakness is scope. A log entry around one SDK method may include automatic retries, or it may expose only the final result. A successful return can therefore conceal earlier failures and substantial waiting. Streaming adds another trap: receiving response headers does not mean the user has received useful text.
Verdict: SDK logs win for immediate debugging. They lose as the sole source of latency and reliability metrics unless their timing boundaries and retry behavior are explicitly documented.
Application traces win the user-visible latency test
Application instrumentation can measure the complete operation: queueing, retrieval, model calls, tool execution, retries, and response delivery. Record an end-to-end duration for the logical request, then create separate spans for individual outbound attempts. This separates a slow model response from an overloaded worker or a slow tool.
For streaming calls, record time to first usable content and time to stream completion separately. Also record interrupted streams. A call that emits one fragment and then disconnects is not equivalent to a completed response, even if its initial HTTP status was successful.
Compare latency distributions rather than averages alone. Track p50 and p95, adding p99 when traffic volume supports a meaningful estimate. Segment by requested model, streaming mode, input size, and output size. Comparing short Gemini 2.5 Flash responses with long Claude Haiku 4.5 generations without those controls can produce a misleading ranking.
Verdict: Application traces win for user experience and root-cause analysis. They require more engineering work, but they expose delays that an external API boundary cannot see.
API-boundary metrics win the shared traffic view
Metrics at a controlled egress point provide a common measurement boundary across applications and model destinations. They are useful for identifying clusters of connection failures, rate-limit responses, and slow upstream requests. Unlike application traces, however, they cannot explain time spent before a request reaches that boundary.
Define error rates before comparing them. Attempt error rate counts failed outbound attempts divided by all outbound attempts. Logical-request failure rate counts user operations that ultimately fail divided by all user operations. Track both: retries can improve the second while worsening load and latency. Treat cancellations, invalid client requests, timeouts, and upstream failures as distinct categories.
A relay adds a useful routing boundary, but it also adds another network hop and dependency. Your measurements must distinguish application-to-relay behavior from upstream behavior wherever that information is available. Do not assume a relay supplies detailed traces, exports, or upstream timing unless those capabilities are documented.
Verdict: API-boundary metrics win for cross-application traffic comparisons. They complement application traces rather than replace them.
The handoff decision favors traces plus boundary metrics
- Use application traces as the authority for user-visible duration and final outcomes.
- Use attempt-level boundary metrics to detect retry amplification and shared upstream symptoms.
- Keep SDK logs for targeted diagnosis, with request correlation and sensitive-data controls.
- Alert on sustained latency or failure changes against your own service objectives, and include traffic volume so low-sample spikes remain visible.
Relay365 fits teams that want pay-as-you-go access to multiple model families through a shared relay. Its compatibility with Claude Code, Codex, Gemini CLI, and OpenAI SDK clients can simplify access configuration; that is not, by itself, a monitoring guarantee. Create a Relay365 account if that routing model suits your workload, then validate telemetry coverage before production rollout.
The final duty-desk verdict is clear: choose SDK logs for fast inspection, application traces for customer impact, and boundary metrics for shared traffic health. Keep all three tied to the same logical request, and the next shift inherits evidence rather than a vague report that the model feels slow.
Further desk bulletins
| Date | Bulletin title | Filed under | Language |
|---|---|---|---|
| 2026-10-30 | Shift log: cap in-flight calls, bound the waiting line | Wire & endpoints | EN |
| 2026-10-30 | Shift Log: Tool-Calling Providers, Contracts, and Verdicts | Wire & endpoints | EN |
| 2026-10-30 | Shift Log: Overlap Wins the API Key Rotation Window | Wire & endpoints | EN |
| 2026-10-30 | Shift Note: Bare Hosts and Doubled /v1 Paths | Wire & endpoints | EN |
| 2026-10-30 | Shift note: 429s need queues, not faster retries | Wire & endpoints | EN |
| 2026-10-30 | Duty Log: Retry Storm Contained, Backoff Kept | Wire & endpoints | EN |
Curious how it runs on your own code? Sign up →