25 days ago
hello railway team , is there a way to connect my railway via SDK or apis for the analytics , metrics and error crashes , i want to connect it via my admin dashboard , so im asking for a possibility to do it or is there a way to handle what i ask for and thanks!
2 Replies
25 days ago
You can use Railway's public API to access project logs and usages.
Playground: https://railway.com/graphiql
Docs: https://docs.railway.com/guides/public-api
Edit: add docs link
25 days ago
Hey, expanding on the previous answer, there are a few things that you could do:
For logs, there's Locomotive which basically streams your logs to any API endpoint: https://railway.com/deploy/locomotive. Also, Railway features a Webhook capability that sends notifications whenever crashes occur to any API endpoint. You can enable it by going to your project settings and then click on Webhooks.
Now, if you want direct access to the Railway API for things such as metrics (CPU, RAM, Volume, and more), you could use a community-maintained Javascript SDK: https://github.com/crisog/railway-sdk. For any other language, you would need to implement the GraphQL API manually.
Let me know if you've any other questions!
