Skip to main content

http_logs

Creates, updates, deletes, gets or lists a http_logs resource.

Overview​

Namehttp_logs
TypeResource
Idrailway.observability.http_logs

Fields​

The following fields are returned by SELECT queries:

One row per HttpLog. The result of a http logs query.

NameDatatypeDescription
deployment_idstringThe deployment ID that was requested
deployment_instance_idstringThe deployment instance ID that was requested
request_idstringThe unique request ID
client_uastringThe client user agent
downstream_protostringThe downstream HTTP protocol version
edge_regionstringThe edge region the client connected to
hoststringThe requested host
http_statusintegerThe http status of the log
methodstringThe request HTTP method
pathstringThe requested path
response_detailsstringDetails about the upstream response
rx_bytesintegerReceived bytes
src_ipstringThe source IP of the request
timestampstringThe timestamp the log was created
total_durationintegerThe total duration the request took
tx_bytesintegerOutgoing bytes
upstream_addressstringThe upstream address
upstream_errorsstringAny upstream errors that occurred
upstream_protostringThe upstream HTTP protocol version
upstream_rq_durationintegerHow long the upstream request took to respond

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_idafter_date, after_limit, anchor_date, before_date, before_limit, filterFetch HTTP logs for a deployment. Backed by the Railway GraphQL query httpLogs. A SQL LIMIT is pushed down to the limit argument.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_idstring
after_datestringLatest date to look for logs after the anchor.
after_limitintegerLimit the number of logs returned after the anchor.
anchor_datestringTarget date time to look for logs.
before_datestringOldest date to look for logs before the anchor.
before_limitintegerLimit the number of logs returned before the anchor.
filterstringFilter logs using a query syntax.

SELECT examples​

Fetch HTTP logs for a deployment. Backed by the Railway GraphQL query httpLogs. A SQL LIMIT is pushed down to the limit argument.

SELECT
deployment_id,
deployment_instance_id,
request_id,
client_ua,
downstream_proto,
edge_region,
host,
http_status,
method,
path,
response_details,
rx_bytes,
src_ip,
timestamp,
total_duration,
tx_bytes,
upstream_address,
upstream_errors,
upstream_proto,
upstream_rq_duration
FROM railway.observability.http_logs
WHERE deployment_id = '{{ deployment_id }}' -- required
AND after_date = '{{ after_date }}'
AND after_limit = '{{ after_limit }}'
AND anchor_date = '{{ anchor_date }}'
AND before_date = '{{ before_date }}'
AND before_limit = '{{ before_limit }}'
AND filter = '{{ filter }}'
;