Skip to content

Requests Logging in Inference-Server

Request logs if enabled are stored in a timescale DB table with this format:

CREATE TABLE IF NOT EXISTS block_inference (
                request_id UUID PRIMARY KEY,
                session_id TEXT,
                block_id TEXT,
                seq_no INTEGER,
                ts TIMESTAMPTZ,
                frame_ptr BYTEA,
                data BYTEA,
                query_parameters BYTEA,
                output_ptr BYTEA,
);

A timeseries index is built over the ts column:

SELECT create_hypertable('block_inference', 'ts', if_not_exists => TRUE);

Files are not logged/saved due to the storage constraints.

Request logging APIs

Global inference server provides APIs to query the stored logs, some of these APIs are as follows:

Get Logs by session_id

  • Retrieves all logs for a given session.

cURL Command:

curl -X GET "<server-url>/logs/session/<session_id>"

Get Logs by request_id

  • Fetches log records associated with a specific request.

cURL Command:

curl -X GET "<server-url>/logs/request/<request_id>"

Get Logs by block_id

  • Retrieves all logs linked to a specific block execution.

cURL Command:

curl -X GET "<server-url>/logs/block/<block_id>"

Get Logs by session_id and block_id

  • Fetches logs filtered by both session and block ID.

cURL Command:

curl -X GET "<server-url>/logs/session_block?session_id=<session_id>&block_id=<block_id>"