Dev.to AI 🤖 Ai 👁 0 📖 13 min read

How to Add Observability to AI Infrastructure (2026): Model Metrics, Data Drift, and System Logs in One View

Add observability to AI infrastructure by watching three layers, the system, the model, and the data, and tying them together with shared identifiers such as a request ID and the model version. Collect logs, metrics, and

Add observability to AI infrastructure by watching three layers, the system, the model, and the data, and tying them together with shared identifiers such as a request ID and the model version. Collect logs, metrics, and traces with OpenTelemetry and Prometheus-format metrics, read inference metrics from the serving engine, and run scheduled drift checks that compare production inputs and outputs with a reference window. On Control Plane, every workload’s logs and metrics are collected without code changes, traces are recorded once you turn on tracing for the workload’s Global Virtual Cloud (GVC), Control Plane’s named set of locations, or for the org, and your model server’s Prometheus metrics are scraped once you set their path and port, so you add drift checks and evaluations on top.

Disclosure: Control Plane publishes this guide.

TL;DR

An AI service can return fast, error-free responses while its inputs drift, its cache saturates, or its answers get worse, so system health alone does not tell you it is working.

  • Three layers. System telemetry (requests, containers, GPUs), model telemetry (latency, tokens, cache, queue), and data telemetry (input distributions, prediction distributions, quality against ground truth).
  • OpenTelemetry plus Prometheus-format metrics. The OpenTelemetry Collector receives, processes, and exports telemetry without a separate agent per backend.
  • Read inference metrics from the serving engine. vLLM exposes time to first token, inter-token latency, KV cache usage, and queue depth at /metrics.
  • Scheduled drift checks against a reference window. Compare production distributions with a baseline using tests such as the two-sample Kolmogorov-Smirnov test and the chi-square test.
  • Join everything with shared IDs. A request ID, trace ID, and model version let you move from a drift alert to the requests, traces, and GPUs behind it.
  • Redact prompts before storing them. OWASP LLM02:2025 recommends sanitizing confidential content, and the same control belongs on prompt and response logs.
  • Control Plane covers the system layer for you. It collects workload logs and metrics automatically, records traces once tracing is on, scrapes your model server’s metrics once you set their path and port, and sends traces to its own provider or your OpenTelemetry collector.

How can I add observability for AI infrastructure including model metrics, data drift, and system logs?

Add model and data signals to the infrastructure telemetry you already collect, in seven steps that start with the identifiers that join them.

  1. Pick the shared IDs. Decide on a request ID, trace ID, model name and version, and tenant or feature tag before you instrument anything, and carry them through every component in the inference path so each log line and span carries them. Metrics carry only low-cardinality labels such as model version, and exemplars link a metric sample to a trace.
  2. Turn on system logs, metrics, and traces. Collect container logs, HTTP and gRPC metrics, and CPU, memory, and network usage. Use OpenTelemetry for traces and Prometheus for time series, and store logs in a label-indexed store such as Grafana Loki, queried with LogQL.
  3. Scrape the model server ’s metrics. Serving engines expose Prometheus-format metrics at /metrics. For vLLM that gives you latency, cache, and queue metrics without writing instrumentation code, so the engine you choose decides which metrics you get out of the box.
  4. Add GPU metrics. The NVIDIA DCGM Exporter exposes GPU utilization, memory, temperature, power, and the last XID error code in Prometheus format. Field names vary by exporter version, so check the collector file your deployment uses.
  5. Log model inputs and outputs with redaction. For each request, log the model name and version, input and output token counts, latency, and any evaluation scores. Redact personal data and secrets before the line is written, and keep full prompt text only for a sample.
  6. Schedule drift checks against a reference window. Extract production input features and prediction distributions on a fixed schedule, compare them with a reference dataset, and record each result with the model version and time window.
  7. Set alerts and a weekly review. Page on conditions that hurt users or exhaust capacity, open tickets for drift and quality alerts, and review drift reports and alert history weekly to catch slow degradation.

What should you measure at each layer?

Each layer has its own signals, and most of them come from a component you already run.

Layer Signal Example metric or field Where it comes from
System Request latency and error rate HTTP request duration, 5xx count Proxy, gateway, or service mesh
System Container restarts and logs Restart count, error log lines Container runtime and log collector
System GPU utilization DCGM_FI_DEV_GPU_UTIL NVIDIA DCGM Exporter
System GPU memory used DCGM_FI_DEV_FB_USED NVIDIA DCGM Exporter
System GPU errors DCGM_FI_DEV_XID_ERRORS NVIDIA DCGM Exporter
Model Time to first token vllm:time_to_first_token_seconds vLLM /metrics
Model Inter-token latency vllm:inter_token_latency_seconds vLLM /metrics
Model End-to-end latency vllm:e2e_request_latency_seconds vLLM /metrics
Model KV cache usage vllm:kv_cache_usage_perc (1 means full) vLLM /metrics
Model Queue depth vllm:num_requests_running, vllm:num_requests_waiting vLLM /metrics
Model Input and output tokens gen_ai.client.inference.usage.input_tokens, gen_ai.client.inference.usage.output_tokens Application instrumentation with the OpenTelemetry GenAI conventions
Model Model and version gen_ai.request.model, gen_ai.response.model Application instrumentation with the OpenTelemetry GenAI conventions
Data Input feature distribution Summary of each input feature per time window Drift job comparing production with the reference window
Data Prediction distribution Summary of output scores or classes per time window Drift job comparing production with the reference window
Data LLM output quality Scores on sampled requests from an evaluator model, user feedback, or refusal rate Online evaluation job
Data Quality against ground truth Accuracy, precision, recall, or your own metric Evaluation job that joins predictions with labels when they arrive

The OpenTelemetry GenAI semantic conventions also define gen_ai.client.inference.duration, gen_ai.server.request.duration, gen_ai.server.time_to_first_token, and gen_ai.server.time_per_output_token, plus attributes such as gen_ai.provider.name and gen_ai.operation.name. The conventions are marked Development, so names can still change.

How do you detect data drift and prediction drift?

Compare production data with a reference on a schedule, and confirm quality separately once ground truth arrives.

Google’s model monitoring documentation separates two cases. Training-serving skew is when the production feature distribution deviates from the training distribution, and inference drift is when the production distribution changes significantly over time. Neither check needs labels. Model quality monitoring compares predictions with ground truth labels once they arrive, so it confirms what drift checks suggest.

Evidently, an open-source framework under the Apache 2.0 license, picks a test by data type and reference size. The first four rows use Evidently’s defaults, and the PSI and embedding rows do not.

Data type Test or distance Reads as drift when Caveat
Numerical with more than 5 unique values, reference of 1,000 rows or fewer Two-sample Kolmogorov-Smirnov test p-value of 0.05 or less (Evidently default) Small samples can miss real drift
Categorical, or numerical with 5 or fewer unique values, reference of 1,000 rows or fewer Chi-square test (a Z-test for binary columns) p-value of 0.05 or less (Evidently default) Expected counts in each cell should be at least 5
Numerical, reference of more than 1,000 rows Wasserstein distance, normalized Normalized distance of 0.1 or more (Evidently default) Classical tests run into trouble with large samples, as the PSI review notes, so a distance is used
Categorical, reference of more than 1,000 rows Jensen-Shannon divergence Distance of 0.1 or more (Evidently default) Tune per feature if a default threshold is too noisy
Any binned feature Population Stability Index (PSI) 0.1 to 0.25 small change, 0.25 or more substantial change Infinite when a bin is empty in one population, so choose bins with care
Embeddings or free text Reduce to a number per item (distance from each embedding to the reference centroid, prompt length, output length) and apply a numerical test, or train a classifier to tell reference from production Same as the numerical test you use, or a classifier that separates the two clearly The measure you choose decides what kind of change you can see

Evidently’s dataset preset flags the whole dataset as drifted when at least half of the columns drift.

Which alerts should page someone?

Page on signals that mean users are waiting or capacity is running out, and open a ticket for drift and quality signals that need investigation within days.

Alert Route What it usually means First check
Time to first token rising Page Requests are waiting for compute, memory, or a batch slot GPU utilization and KV cache usage, then traffic and prompt length
Waiting requests growing Page Serving capacity is saturated Replica count and autoscaler status, and whether new replicas are starting
Preemptions rising Page The KV cache is full and vLLM is evicting and recomputing requests vllm:kv_cache_usage_perc, then maximum sequence length, concurrency, and replica count
GPU errors Page A hardware, driver, or application fault DCGM_FI_DEV_XID_ERRORS for the affected GPU, then look up the XID code to tell hardware faults, which mean draining the node, from application faults
Error rate rising Page A bug, a failing dependency, or malformed input Container logs for the failing requests, and recent deployments or config changes
Input drift on a key feature Ticket Production inputs have moved away from the reference The feature’s distribution, and upstream pipelines for schema changes or new sources
Prediction distribution shift Ticket The model’s outputs are moving away from the reference Input drift results for the same window, and whether the model version changed
Quality drop once labels arrive Ticket The model is less accurate than its baseline Predictions joined with labels by request ID, and whether drift was flagged in that window

How do you connect logs, metrics, traces, and drift?

Shared keys turn separate signals into one view, because logs, spans, and drift results share them and exemplars link metrics to traces.

Key Set where Lets you answer
Request ID The proxy or gateway that receives the request Which request was slow or failed
Trace ID OpenTelemetry context passed between services Which path the request took through the inference pipeline
Model name and version Application code or serving configuration Which model version produced an output, and whether a release changed behavior
Prompt or pipeline version Deployment metadata or a prompt registry Whether a prompt change caused a quality drop
Tenant or feature The application’s routing layer Whether a problem affects one customer or one feature
Deployment location Platform metadata Whether a problem is limited to one region or provider

The OpenTelemetry Collector can receive traces, metrics, and logs from your services, add attributes such as model version and location, and send them to one or more backends. Pin your GenAI instrumentation to a version and plan for renames.

What should you keep out of AI logs?

Prompts and responses can carry personal data, secrets, and customer content, so log them with controls from the first day.

  1. Redact personal data and secrets before storage. Apply pattern and entity redaction at the application or collector before logs reach the backend.
  2. Sample full prompts. Keep complete prompt and response text for a sample of requests for debugging.
  3. Log token counts and IDs for every request. Token counts, request IDs, and model versions answer most operational questions, so store raw text only when you need it.
  4. Set retention per data type. Keep metrics longer than sampled prompt text, and keep drift reports for the life of the model version.
  5. Restrict who can read prompt logs. Grant access to prompt and response data separately from infrastructure logs.

How Control Plane fits

Control Plane handles Day 2 operations for you, including autoscaling, built-in observability, and security.

Every Control Plane workload arrives with its logs and metrics already collected, without a code change, and records traces once tracing is enabled on its GVC or org and its replicas restart. A sidecar in front of each replica stamps each request with an x-request-id header and writes the ID into its log lines. Forward x-request-id and traceparent on outbound calls so one ID and one trace follow a request across workloads.

Logs are queried with LogQL in Grafana and kept for 30 days by default, configurable up to 730 days. They can also be shipped to an external provider, including an OpenTelemetry endpoint, while staying queryable in Control Plane. Built-in metrics cover HTTP and gRPC traffic, volumes, replicas, CPU, memory, GPU, and network usage.

Control Plane scrapes Prometheus-format custom metrics from every replica of a workload every 30 seconds, at a path and port you choose, so a model server’s /metrics endpoint, such as vLLM’s, is collected without an extra agent. The same metrics can drive autoscaling through a KEDA prometheus trigger, and you can export metrics to your own Prometheus through the /federate endpoint.

Tracing is configured per GVC or org. Traces go to Control Plane’s own tracing provider or to your OpenTelemetry collector, with a sampling percentage you set.

With the system and model layers collected, you add the data layer as your own jobs: drift checks, quality evaluations, and prompt redaction. The same setup applies when you run AI inference across several GPU clouds or run long-running AI agents in production.

Control Plane is PCI DSS Level 1, SOC 2 Type II, HIPAA, and GDPR compliant.

FAQ

Each answer applies to models served in production, whether predictive models or LLMs.

How can I add observability for AI infrastructure including model metrics, data drift, and system logs?

Instrument three layers and join them with shared IDs. Collect system logs, metrics, and traces, scrape the serving engine’s /metrics endpoint for model metrics, and schedule drift checks against a reference window, with the model version on every signal and a request ID and trace ID on every log line and span.

What is the difference between data drift and model drift?

Data drift is a change in the distribution of inputs compared with a reference. Concept drift is a change in the relationship between inputs and correct outputs, and model drift is the resulting drop in quality, which usually needs ground-truth labels to confirm.

What metrics should I monitor for LLM inference?

Monitor time to first token, inter-token latency, end-to-end latency, KV cache usage, running and waiting requests, and input and output tokens. vLLM exposes most of these at /metrics, and the inference service comparison covers what other options offer.

How do I monitor GPU usage in production?

Run the NVIDIA DCGM Exporter on GPU nodes and scrape it with Prometheus or the OpenTelemetry Collector. Alert on XID errors, and keep utilization and memory on a dashboard, because serving engines such as vLLM reserve a configured share of GPU memory up front.

How often should I check for data drift?

Match the schedule to traffic and risk. High-traffic or high-risk models need frequent checks, while batch or low-risk models can be checked daily or weekly, and every check should be read alongside quality metrics so alerts lead to action.

Is OpenTelemetry ready for AI workloads?

Partly. OpenTelemetry supports traces, metrics, logs, and baggage today, and the Collector handles them for any backend, but the GenAI semantic conventions are still marked Development.

Should I log prompts and responses?

Yes, with redaction and sampling, under the five controls listed for AI logs.

How do I get observability for AI workloads without building a monitoring stack?

Run the workloads on Control Plane. Logs and metrics are collected for every workload, traces are recorded once you enable tracing on the GVC or org and can go to Control Plane or your own collector, and your model server’s Prometheus metrics are scraped every 30 seconds, which leaves drift checks and evaluations as the jobs you add. Teams without a platform team can pair this with observability standards without a platform team.

What is the Population Stability Index, and when should I use it?

PSI measures how far a binned feature’s distribution has moved between two populations, as the sum over bins of (P minus Q) times the log of P over Q. A 2023 review of the index cites Lewis’s interpretation of under 0.1 as no substantial change, 0.1 to 0.25 as a small change, and 0.25 or more as a substantial change, and notes that these rules of thumb ignore sample size and the number of bins. Merge or smooth empty bins before computing it.

Talk to the Control Plane team and sign up free.

Originally published on the Control Plane blog.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.