Requesty
Back|MAY '26OBSERVABILITY / BEST PRACTICES
15 MIN READ|

LLM observability at the gateway: What to log, measure and alert on (2026)

Last updated

A support agent can return HTTP 200 and still give the wrong answer or fail to finish its task. LLM observability collects logs, metrics, traces and quality signals to explain what happened. Requesty records routed model traffic; Langfuse, LangSmith and Arize Phoenix add instrumented application traces and evaluations.

What does LLM observability cover?

Logging records individual events. Monitoring aggregates events into measures and alerts. Tracing connects steps in a workflow, and evaluation checks the result against a defined standard.

Follow one support agent run: it retrieves documents, calls a model, runs a search tool and calls the model again. The gateway sees the routed model requests and tool calls or results included in their messages. The external tool runs in the application. Langfuse's tracing documentation describes spans for model calls, retrieval and custom logic.

An application run moves through retrieval, a gateway model call, external tool execution, a second gateway model call with the tool result, and an outcome. Gateway logs cover both routed calls, and the application supplies a shared run ID.
The gateway and application tracer cover different parts of a run. The shared run ID is supplied by the application.

The two do overlap. Requesty Logs groups calls carrying the same trace_id and shows a waterfall of gateway interactions. If an MCP call passes through Requesty's MCP Gateway, its MCP analytics provide another view of that call.

Which LLM observability tool should you use?

Choose by the work you need to inspect and the infrastructure you are willing to run. Product details are as of October 2026. We make Requesty, one of the products below. Application traces require instrumentation. For pricing and retention, see our comparison of LLM observability tools.

ToolPick it forBoundary or operating choice
RequestyManaged gateway logs, grouped model calls, routing and spend controlsRoute calls through Requesty. Add application instrumentation for external steps and evaluation.
LangfuseSelf-hosted application traces, datasets and evaluationsOperate the deployment. Its repository is MIT licensed except for ee folders.
LangSmithApplication trace review and online or offline evaluations, including outside LangChainLangSmith also has a beta gateway.
Arize PhoenixSelf-hostable tracing and evaluation for RAG and agent workflowsIts Elastic License 2.0 restricts certain managed-service uses.
HeliconeGateway access with request traces and sessionsIts OpenAI-compatible proxy is one integration path. The repository also documents self-hosting.
PortkeyGateway request logs and tracing, including fallback and retry spansAccepts traceparent and baggage headers for trace context and metadata.
Datadog Agent ObservabilityExisting Datadog teams that need infrastructure correlation and AI evaluationsUse application instrumentation to connect model activity with the monitored environment.

For example, pick Requesty to find which model calls made a support run expensive, and Langfuse to inspect retrieval and tool spans for that run. Record a shared opaque run ID in both systems. This application-supplied link does not automatically create an OpenTelemetry trace join.

Divide the work by observation point

QuestionGateway trafficInstrumented application or tracer
Which model served the call, how long did it take and what did it cost?Routed request logs and analyticsClient timing and calls bypassing the gateway
What happened during retrieval or external tool execution?Tool requests and results present in routed messagesRetrieval, execution, retries and results recorded as spans
Did the user receive a useful answer?Status, finish reason and available feedbackStream completion, validators, evaluations and business outcomes
Which calls belong to this run?Group gateway calls by supplied run IDPropagate the ID through instrumented steps

What to log for each LLM request

Here is the schema we would use for your own logs.

Field groupRecordWhy
IdentityTimestamp, request ID, opaque run ID, key IDFind and correlate calls
ContextFeature, environment, prompt versionCompare workloads and deployments
RouteRequested and served model and provider, routing policySee fallback and model changes
ResultStatus, error type and origin, finish reason, stream completion stateSeparate provider, gateway and application failures
UsageInput, output, cached and reasoning tokens when available; cost and cost sourceExplain spend without treating missing usage as zero
TimingTTFT and total latency, each with a defined start and endCompare the same measurement across requests
WorkflowAttempt count, tool-call count, sampled evaluation or downstream outcomeConnect model activity to task completion

Record unavailable values as unknown. A gateway record may not contain every failed upstream attempt; capture attempt-level telemetry wherever your routing and application stack exposes it. A supplied run ID is a grouping key, not automatically a valid W3C trace ID. Keep a mapping if your tracing SDK requires a different format.

Set content policy before collecting payloads

Requesty's data privacy settings retain telemetry when per-key payload logging is off; new keys inherit the organization's default_logging setting. With logging on and organization-wide zero data retention off, Requesty stores truncated messages and responses and a full raw request body in encrypted object storage. Enterprise organization-wide zero data retention stops new payload storage and is irreversible. Historical payloads remain, and upstream provider retention is separate.

Production logging review

0 of 7 done

Keep provider, model, environment and feature as bounded metric dimensions. Put request and user IDs in access-controlled logs or traces. Prometheus cautions against high-cardinality labels, including user IDs and email addresses. Opaque identifiers still require access controls.

The production metrics that matter

A metric is only useful once you define its population, time window and boundary. A percentile is a value at or below which a share of observations falls: p95 means roughly 95% of the observed requests are at or below that value. Show request counts alongside percentiles, and compute an overall p95 from raw samples or compatible histograms. Do not average p95s from separate providers or time buckets.

SignalDefinition and breakdownWhat to inspect
First visible contentClient time from request start to first visible text, by feature and served providerCompare with gateway TTFT, input size and retrieval time
Total latencyDuration from a named start to a named finish, by model and providerSeparate gateway round trip from browser rendering and earlier app work
Output rateOutput tokens divided by a defined generation intervalSeparate visible-text rate from billed output and system-wide throughput
Error rateFailures divided by all requests in the same cohort and windowSplit 429, 5xx, timeout, rejection and interrupted streams
Attempt versus final failureFailed attempts divided by attempts; failed logical requests divided by logical requestsFind degradation hidden by retries or fallback
Tokens and costInput, output, cache reads and writes, reasoning where available; cost by feature, key and modelCompare volume, token mix and effective prices
Cost per completed taskSum of model costs for calls and attempts belonging to completed tasks, divided by completed tasksCompare task cost across prompt versions and workflows
Cache useRequests with cache use divided by eligible requests; cached input tokens divided by relevant input tokensCompare the request and token ratios for each route
Completion and qualityCompleted streams, validator failures and evaluated outcomes divided by their respective eligible populationsInspect truncation, bad answers and failed tool execution

The cost-per-completed-task definition above excludes failed and canceled runs. Report their costs separately for a total operating-cost view; you can also divide all run costs by completed tasks. Choose one system of record for model costs and reconcile with provider invoices. Adding the gateway's cost to a tracer's estimate for the same call double-counts it.

Cache hit ratios need the same care. Assume 100 eligible requests each contain 1,000 relevant input tokens. If 50 requests use the cache and together read 10,000 cached input tokens, the request hit rate is 50 / 100 = 50%, while the token cache rate is 10,000 / 100,000 = 10%. Define reads, writes and unknown usage consistently. Requesty's auto caching uses provider prompt caching; a cache hit does not mean the entire response was served from a response cache.

Streaming has more than one clock

Time to first token (TTFT) needs a start point and an end point. The first streaming chunk can contain metadata or an empty delta with no visible text. Measure first visible content in the client with a monotonic clock. Requesty log details include TTFT and total latency for the gateway request; those values do not include all browser rendering or retrieval work before the call. OpenAI's streaming guide describes streamed events.

Two independent timing lanes show client action to first rendered text and gateway receipt to final-byte send. The lanes use separate clocks and show no cross-system event ordering.
Client-visible latency and gateway duration have different boundaries. A metadata-only chunk can arrive before visible text.

Now, the missing-data problem. For Chat Completions, Requesty's streaming documentation provides usage in a final chunk when include_usage is enabled. That chunk has an empty choices list. An interrupted stream can end before it arrives, as the OpenAI SDK's chunk definition notes. Keep missing usage unknown and investigate available gateway and provider records.

Build a dashboard for three time horizons

Put gateway and application telemetry together in three views.

Three dashboard panels show last-hour latency and errors, last-24-hour tokens, cache and task costs, and last-30-day spend and evaluated outcomes. Source badges distinguish gateway and application data.
Use the last hour for incident response, the last day for operational comparisons and the last month for spend and outcomes.
ViewPut on the panelDrill down by
Last hourClient first-content p95, gateway total latency, attempt errors, completed streamsFeature, served provider, error type
Last 24 hoursTokens, cache request and token rates, final success, cost per completed taskModel, prompt version, feature
Last 30 daysSpend by key and feature, task cost distribution, evaluated outcomesTeam, feature, prompt version

Requesty Analytics provides cost, tokens, cache metrics and latency breakdowns. Its Advanced view supports p95 and p99 calculations and grouping by model, provider, user or custom fields. Add client timing, task completion and evaluation results to your monitoring stack.

Alert on conditions someone can act on

Assume the following thresholds for an initial trial. Adjust them to the traffic volume, baseline and impact of each feature. A small sample makes a percentile noisy; alert separately when telemetry stops arriving. Give each alert an owner who can inspect the logs and take the listed action.

Alert and sourceExample ruleOwner and first action
First visible content: application metrics grouped by feature and served providerp95 above 3 seconds over 10 minutes, with at least 100 completed streams in the cohortApplication on-call: compare client and gateway timing, provider and input size; monitor missing or interrupted streams separately
Provider errors: attempt metrics grouped by provider5xx or timeout fraction above 5% over 5 minutes, with at least 100 attempts for that providerPlatform on-call: inspect provider status and fallback; compare final request failures
Monthly key spend: Requesty webhookAPI key reaches 80% of its monthly capBudget owner: inspect key, feature and expensive runs; check the cap
Spend velocity: external metrics or warehouseLast hour's cost exceeds twice the same-hour average for the previous 7 days and a chosen minimum dollar amountBudget owner: compare volume, cost per task and cache use; handle a zero baseline separately
Quality: application or evaluation backendFailed validator or eval share above 10% in a rolling hour, with at least 50 evaluated outcomes, sustained 15 minutesFeature owner: inspect sampled traces and review confirmed failures
Agent loop: application runtimeMore than 20 model or tool steps in one run, or a task-specific cost ceilingAgent owner: stop or request review; inspect repeated calls and idempotency

Requesty documents spending webhooks. Implement latency, attempt, quality and loop rules in the application or a monitoring backend that receives those signals. A task-level step or cost limit belongs in application logic.

To set the native spend alert, first set a monthly API key spend limit. In Admin Panel, open Alerts, select Add Webhook and save a valid JSON, Slack or Teams endpoint. Select Add Alert, choose API Key % of Budget and enter 80. The alert fires on threshold crossing; the JSON event uses apikey.budget.exceeded_percent. Protect the receiver and handle duplicate deliveries.

Debug four common incidents

The response feels slow

Compare client first-visible-content time with gateway TTFT and total duration. If the client waits longer than the gateway measurement suggests, inspect retrieval, network and rendering spans. If generation continues slowly after visible text begins, compare output length and your defined output rate. Check the served provider, input size and cache usage before changing models.

A length finish reason indicates a token limit was reached in OpenAI Chat Completions. Inspect the answer for truncation and review the limit. Finish-reason semantics depend on the endpoint; a tool_calls result means the model requested a tool, not that the tool succeeded. See the OpenAI SDK finish-reason definitions.

Spend rose overnight

Compare the number of completed tasks and the cost per completed task. Account separately for failed and canceled runs, then inspect requests per task. Filter by feature and key, and compare input, output, cached tokens and the served model against the previous period. A prompt change can alter the cacheable prefix; Anthropic's caching documentation distinguishes cache writes, reads and uncached input.

Open an expensive run and count model calls and tool steps. Reconcile the chosen cost record with provider billing. Use request metadata to attach a feature to each call and group cost by that field. For attribution across an organization, see how to track LLM spend per team, user or customer.

Users succeed, but a provider is failing

A fallback can return a successful final answer after an upstream attempt fails. Compare requested and served providers, then inspect failed attempts where your instrumentation exposes them. Separate 429s from 5xx responses and timeouts. A 429 has several possible causes, including quota or capacity; inspect its origin and sanitized error message before changing retry behavior. See how to diagnose a 429 and Requesty's fallback policies.

An agent loops or returns a bad answer

A repeated tool request hints at a loop; it does not prove one. Inspect tool execution spans, arguments and results to see whether the run made progress. Enforce a task-specific step count or cost ceiling in the application and protect side-effecting tools against duplicate execution.

For a bad answer with a successful status, inspect the retrieved context, finish reason and validator or human review. Select representative production failures under your content policy and have a domain reviewer label the expected outcomes. Run those cases offline against prompt or model changes, and monitor sampled live outcomes online. Langfuse and LangSmith document these evaluation workflows. Calibrate automated judges against human labels and track the share of outcomes evaluated.

Investigate a request with Requesty

Requesty records the model calls in a run, so you can find the expensive or slow call without searching each provider dashboard. Point the OpenAI SDK at Requesty, attach a run ID and filter Logs for that ID. The example uses our documented request metadata and analytics headers. As of October 2026, openai/gpt-6.1-terra is available in the Requesty model catalog.

Create a Requesty API key, top up the prepaid balance in Billing settings for the paid model, install the OpenAI Python SDK with pip install openai, and set REQUESTY_API_KEY to your key. The metadata values below are examples; create a unique opaque run ID for each workflow and use your own opaque user ID.

Python
import os
from uuid import uuid4
from openai import OpenAI
 
run_id = str(uuid4())
client = OpenAI(
    api_key=os.environ["REQUESTY_API_KEY"],
    base_url="https://router.requesty.ai/v1",
    default_headers={"X-Requesty-Environment": "production"},
)
 
response = client.chat.completions.create(
    model="openai/gpt-6.1-terra",
    messages=[{"role": "user", "content": "Summarize the incident."}],
    extra_body={"requesty": {
        "tags": ["support"],
        "user_id": "user_123",
        "trace_id": run_id,
        "extra": {"feature": "support-chat", "prompt_version": "v3"},
    }},
)
print("Run:", run_id, "Completion:", response.id)

Reuse run_id across calls in the same workflow and record it as an attribute in your application trace. Requesty's custom analytics headers are captured for analytics and stripped before forwarding to the provider. Keep per-user and per-run values in per-request metadata instead of shared client headers.

  1. 1
    Find the call

    Open Logs, filter by the run's trace ID and inspect the request's status, used provider, token counts, cost, TTFT and finish reason. Payload visibility follows your logging policy.

  2. 2
    Inspect the run

    Switch to Traces and open the waterfall for calls with that ID. Use the same ID to find retrieval and tool spans in your application tracer.

  3. 3
    Compare the cohort

    In Analytics, open Advanced, choose Cost and group by the feature field from the example. To inspect tail latency, select Latency, group by provider and choose p95 or p99. Use Savings to compare cache request and token rates; export the data summary for external analysis.

    In Analytics > Tool Calls, group routed requests by tool name to compare request counts and associated model costs.

  4. 4
    Add a spending alert

    Set a key budget and configure the webhook and threshold described above. Add client latency, attempt errors and quality alerts in your monitoring stack.

Start with three alerts

So where do you start? This week, set the key spend alert at 80% of its monthly cap in Requesty. In your monitoring stack, add an attempt error-rate alert per provider and a p95 client first-content latency alert per feature and served provider, using the windows and sample counts above as a starting point. Assign each alert an owner.

Create a Requesty account and route one production feature through the gateway. Pair it with Langfuse or another application tracer when the team needs to investigate the rest of the workflow.

Frequently asked questions
What is LLM observability?
LLM observability is the collection of logs, metrics, traces and quality signals used to understand an AI application's behavior. A gateway records the model calls routed through it, while application instrumentation adds visibility into retrieval, external tools and outcomes.
What are the best LLM observability tools for production?
Requesty fits teams that need gateway-level cost, latency and request logs. Langfuse, LangSmith and Arize Phoenix support instrumented application traces and evaluations; Portkey and Helicone combine gateway access with tracing.
Can an LLM gateway replace Langfuse or LangSmith?
Requesty groups related gateway calls into traces, which can be enough for investigating model traffic. Langfuse or LangSmith adds instrumented application steps and evaluation workflows when you need to inspect retrieval, external tool execution or answer quality.
What metrics should I monitor for LLM applications?
Monitor client time to first visible content, total latency, errors by type, tokens, cost per completed task, cache usage and task outcomes. Separate failed provider attempts from final user-facing failures so successful fallback does not hide an incident.
Can I monitor LLM requests without storing prompts?
Requesty retains operational telemetry when payload logging is disabled for an API key. Enterprise organization-wide zero data retention prevents new prompt and response storage in Requesty and is irreversible; provider retention policies remain separate.
Why are token counts missing from a streaming response?
In Requesty's Chat Completions streaming API, request the final usage chunk with include_usage. A canceled or interrupted stream can end before that chunk arrives, so treat missing usage as unknown and check the available gateway and provider records.
Related reading

Start building with Requesty

One line of code. 600+ models. Full control.

Speak to founders