http_metrics_grouped_by_status
Creates, updates, deletes, gets or lists a http_metrics_grouped_by_status resource.
Overview​
| Name | http_metrics_grouped_by_status |
| Type | Resource |
| Id | railway.observability.http_metrics_grouped_by_status |
Fields​
The following fields are returned by SELECT queries:
- list
One row per HttpMetricsByStatusResult. HTTP metrics grouped by status code.
| Name | Datatype | Description |
|---|---|---|
samples | array | The samples of HTTP metrics for this status code. |
status_code | integer | The HTTP status code. |
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, step_seconds | Get HTTP request metrics for a service, grouped by status code. Backed by the Railway GraphQL query httpMetricsGroupedByStatus. |
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. |
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, grouped by status code. Backed by the Railway GraphQL query httpMetricsGroupedByStatus.
SELECT
samples,
status_code
FROM railway.observability.http_metrics_grouped_by_status
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 step_seconds = '{{ step_seconds }}'
;