Skip to main content
Baseten assigns a unique request ID to every predict call and returns it in the X-Baseten-Request-Id response header, so you can trace a single prediction through your model’s logs.
Per-request log filtering requires Truss version 0.15.5 or later. Upgrade with pip install --upgrade truss.

Scope by environment or deployment

The Logs tab can show entries from a single deployment or from every deployment in an environment. Use the dropdowns at the top of the tab to switch. Environment scope aggregates logs across every deployment in that environment, including past deployments still serving traffic during a rollout. Use it to follow a request across deployment boundaries or to watch a promotion in progress. Deployment scope restricts logs to a single deployment ID. Use it to isolate behavior to one version, such as a development deployment. The same scope applies to live tail and historical search.

Get the request ID

The first step is capturing the request ID from the response. Baseten includes it in every predict response, regardless of whether the call is synchronous, asynchronous, or gRPC. The exact location depends on the protocol you’re using:
When you make a predict call, include the -sD- flag to print response headers alongside the body:
curl -sD- -X POST "https://model-{MODEL_ID}.api.baseten.co/production/predict" \
  -H "Authorization: Bearer $BASETEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello"}'
The request ID appears as a response header:
X-Baseten-Request-Id: 31255019cf83c4d0c7492a5006591e1f502a5

Filter logs by request ID

Once you have a request ID, open the model’s logs page and enter it in the search filter bar using the requestId: prefix:
requestId:31255019cf83c4d0c7492a5006591e1f502a5
The view narrows to show only log entries from that request. Each log line also displays the request ID alongside the replica ID, so you can confirm you’re looking at the right trace even when scrolling through mixed output.

Logging with request context

For standard Truss models, Baseten automatically attaches the request ID to any log emitted through Python’s logging module during a predict call. No configuration is required. Use a logger:
import logging

logger = logging.getLogger(__name__)

class Model:
    def predict(self, request):
        logger.info("Starting prediction")  # request_id is added automatically
        ...

Custom servers

For standard Truss models, Baseten handles request ID logging automatically through the framework’s built-in JSON formatter. No configuration is required. Custom servers don’t have this built-in support, so you’ll need to do two things: extract the x-baseten-request-id header from incoming requests, and include it as a top-level request_id key in your JSON log output. Both steps are covered in the setup guides for custom HTTP servers and custom gRPC servers.

Download logs

Download a deployment’s logs as a file from the Logs tab. Baseten runs the export as a background job and saves the file when it’s ready, so the download reflects the full time range and filters you selected, not only the lines loaded in the view.
  1. Open the Logs tab and set the deployment or environment scope, time range, and any filters (level, request ID, replica, or search).
  2. Select Download CSV or Download JSON.
  3. The file downloads automatically once it finishes preparing.
A single download covers up to 7 days and 100,000 log lines. If you reach either limit, shorten the time range or add filters and export again.

Fetch logs from the CLI

To pull logs from a terminal or script, use the Baseten CLI:
baseten model deployment logs --model-id <model-id> --deployment-id <deployment-id> --since 1h
Scope the window with --start and --end or --since, up to 7 days. Stream live logs with --tail, and pass --output jsonl for machine-readable output. See the baseten model deployment logs reference for the full set of filters.

Export logs to an OTLP endpoint

You can stream the same logs that appear in the Baseten UI to any backend that accepts OTLP over HTTP, including Honeycomb, Datadog, Grafana Cloud, and Sentry. Once configured, every new log line is forwarded to your endpoint in near real time, so you can build dashboards, alerts, and long-term retention on top of your inference traffic without scraping the UI.
Log export is rolling out gradually. If the OTEL connection card isn’t visible in your settings, contact Baseten support to enable it for your organization.

What gets exported

The exporter forwards every log you would see in the Baseten UI, which includes:
  • Build logs: image builds for new deployments.
  • Deploy and promotion logs: lifecycle events emitted as a deployment activates, scales, or is promoted to an environment.
  • Serving logs: stdout and stderr from your model replicas, including anything you write through Python’s logging module.
Each record is sent as an OTLP LogRecord with service.name = "baseten" and an allowlisted set of attributes:
AttributeDescription
messageThe log line.
model_idStable ID of the model the log came from.
model_version_idDeployment (model version) the log came from.
environmentEnvironment name, such as production or staging, when the deployment is attached to one.
replicaReplica ID for serving logs.
request_idPer-prediction request ID. Matches the X-Baseten-Request-Id header.
training_job_idTraining job ID for training logs.
chainlet_idChainlet ID for Chains.
exc_infoFormatted Python traceback, when the log carries an exception.
Baseten maps the original log level to OTLP SeverityNumber and SeverityText (DEBUG, INFO, WARN, ERROR, FATAL) and strips internal labels that aren’t on the allowlist before export, so your backend only receives the same fields you see in the UI. Exports start from the moment the connection is enabled. Historical logs are not backfilled, and delivery is best-effort: Baseten retries transient failures with exponential backoff, but records can be dropped if your endpoint is unreachable for an extended period.

Configure a connection

Each Baseten organization can have one OTLP destination at a time.
1

Open settings

Go to Settings → General and find the OTEL connection card.
2

Add a connection

Click Add connection and fill in:
  • Endpoint URL: The full URL of your OTLP/HTTP logs receiver, including the path (/v1/logs for most receivers). See the integration notes below for per-vendor examples.
  • Header name: The HTTP header your backend uses to authenticate.
  • Header value: The credential for that header. The value is stored encrypted and never displayed again after you save it.
3

Save and verify

Save the connection. New log records start flowing to your endpoint within a few seconds. Click Test on the saved connection to send a probe log and confirm the endpoint and credentials are accepted. For an end-to-end check, send a prediction to a deployment and look for its request ID in your backend.
The Test button is not supported for custom OTLP endpoints. Logs are still forwarded to your endpoint, but you can’t send a probe from the UI to verify the connection.
To rotate credentials or change destinations, use the edit icon on the saved connection. Removing the connection stops exports immediately.

Integration notes

The endpoint and header values below come from each vendor’s OTLP/HTTP documentation. Check those docs for the most current values for your account and region.
Honeycomb accepts OTLP/HTTP at https://api.honeycomb.io/v1/logs (or a region-specific host such as https://api.eu1.honeycomb.io/v1/logs). Authenticate with an ingest API key:
  • Endpoint URL: https://api.honeycomb.io/v1/logs
  • Header name: x-honeycomb-team
  • Header value: Your Honeycomb ingest API key.
On Honeycomb environments that route by service.name, logs land in a dataset named baseten. Honeycomb Classic accounts and other dataset-routing setups route differently. See Honeycomb’s OTLP/HTTP reference for dataset routing and regional endpoints.
Other OTLP/HTTP collectors work the same way. If your backend isn’t listed, fill in the endpoint URL and the auth header (name and value) it documents for OTLP, and Baseten will start sending logs to it.