http_duration_metrics
Creates, updates, deletes, gets or lists a http_duration_metrics resource.
Overview​
| Name | http_duration_metrics |
| Type | Resource |
| Id | railway.observability.http_duration_metrics |
Fields​
The following fields are returned by SELECT queries:
- list
One row per HttpDurationMetricsSample. A single sample of HTTP duration metrics.
| Name | Datatype | Description |
|---|---|---|
p50 | number | 50th percentile (median) request duration in milliseconds. |
p90 | number | 90th percentile request duration in milliseconds. |
p95 | number | 95th percentile request duration in milliseconds. |
p99 | number | 99th percentile request duration in milliseconds. |
ts | integer | The timestamp of the sample. Represented as number of seconds since the Unix epoch. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | end_date, environment_id, service_id, start_date | method, path, status_code, step_seconds | Get 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.
| Name | Datatype | Description |
|---|---|---|
end_date | string (date-time) | The end of the period to get metrics for. |
environment_id | string | |
service_id | string | |
start_date | string (date-time) | The start of the period to get metrics for. |
method | string | Filter by HTTP method (e.g., GET, POST). |
path | string | Filter by request path. |
status_code | integer | Filter by HTTP status code (e.g., 200, 404, 500). |
step_seconds | integer | The frequency of data points in the response. If the stepSeconds is 60, then the response will contain one data point per minute. |
SELECT examples​
- list
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 }}'
;