a month ago
I have a quick question regarding railway's API
I'm looking for an endpoint that I can call that returns a project's resource usage, e.g. RAM, CPU, network etc.
I wasn't able to find it in the Railway Docs.
Does such an endpoint exist or is there a workaround?
Pinned Solution
a month ago
You can query for usage.
2 Replies
a month ago
Yup. That was what I was looking for.
If someone needs it for the future:
query EstimatedUsageForWorkspace(
$measurements: [MetricMeasurement!]!
$workspaceId: String!
$includeDeleted: Boolean
) {
estimatedUsage(
measurements: $measurements
workspaceId: $workspaceId
includeDeleted: $includeDeleted
) {
measurement
estimatedValue
projectId
}
}
with variables:
{
"measurements": [
"BACKUP_USAGE_GB",
"CPU_LIMIT",
"CPU_USAGE",
"CPU_USAGE_2",
"DISK_USAGE_GB",
"EPHEMERAL_DISK_USAGE_GB",
"MEASUREMENT_UNSPECIFIED",
"MEMORY_LIMIT_GB",
"MEMORY_USAGE_GB",
"NETWORK_RX_GB",
"NETWORK_TX_GB",
"UNRECOGNIZED"
],
"workspaceId": "<YOUR WORKSPACE ID>",
"includeDeleted": false
}
{
"Authorization": "Bearer <ACCOUNT LEVEL TOKEN>"
}
Thank you!
Status changed to Solved brody • about 1 month ago