Skip to main content

http_duration_metrics

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

Overview​

Namehttp_duration_metrics
TypeResource
Idrailway.observability.http_duration_metrics

Fields​

The following fields are returned by SELECT queries:

One row per HttpDurationMetricsSample. A single sample of HTTP duration metrics.

NameDatatypeDescription
p50number50th percentile (median) request duration in milliseconds.
p90number90th percentile request duration in milliseconds.
p95number95th percentile request duration in milliseconds.
p99number99th percentile request duration in milliseconds.
tsintegerThe timestamp of the sample. Represented as number of seconds since the Unix epoch.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectend_date, environment_id, service_id, start_datemethod, path, status_code, step_secondsGet HTTP request duration metrics for a service (avg, p50, p90, p95, p99). Backed by the Railway GraphQL query httpDurationMetrics.

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
end_datestring (date-time)The end of the period to get metrics for.
environment_idstring
service_idstring
start_datestring (date-time)The start of the period to get metrics for.
methodstringFilter by HTTP method (e.g., GET, POST).
pathstringFilter by request path.
status_codeintegerFilter by HTTP status code (e.g., 200, 404, 500).
step_secondsintegerThe frequency of data points in the response. If the stepSeconds is 60, then the response will contain one data point per minute.

SELECT examples​

Get HTTP request duration metrics for a service (avg, p50, p90, p95, p99). Backed by the Railway GraphQL query httpDurationMetrics.

SELECT
p50,
p90,
p95,
p99,
ts
FROM railway.observability.http_duration_metrics
WHERE end_date = '{{ end_date }}' -- required
AND environment_id = '{{ environment_id }}' -- required
AND service_id = '{{ service_id }}' -- required
AND start_date = '{{ start_date }}' -- required
AND method = '{{ method }}'
AND path = '{{ path }}'
AND status_code = '{{ status_code }}'
AND step_seconds = '{{ step_seconds }}'
;