http_metrics
Creates, updates, deletes, gets or lists a http_metrics resource.
Overview​
| Name | http_metrics |
| Type | Resource |
| Id | railway.observability.http_metrics |
Fields​
The following fields are returned by SELECT queries:
- list
One row per HttpMetricsSample. A single sample of an HTTP metric.
| Name | Datatype | Description |
|---|---|---|
ts | integer | The timestamp of the sample. Represented as number of seconds since the Unix epoch. |
value | number | The value of the sample (count of requests). |
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 metrics for a service. Backed by the Railway GraphQL query httpMetrics. |
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 metrics for a service. Backed by the Railway GraphQL query httpMetrics.
SELECT
ts,
value
FROM railway.observability.http_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 }}'
;