N
Neon16mo ago
correct-apricot

Endpoint to ping

Hi there! A couple days ago we hit the maximum of the free plan Data transfer. We quickly upgraded to the Launch plan, but I’m curious if there’s any way to know if our service is down. We’re currently using uptimerobot.com to monitor our websites and APIs. Is there any way to check if everything is operative in our database? Something like a “GET /ping, response ‘pong’” type of thing or something like that. Thanks in advance.
13 Replies
eastern-cyan
eastern-cyan16mo ago
I think you could send a query “SELECT 1” to the serverless endpoint (/sql)
sensitive-blue
sensitive-blue16mo ago
This isn't an easy question to answer since its a serverless database, and you probably don't want to keep you database up constantly. I'll need to see if neonstatus.com has an API
correct-apricot
correct-apricotOP16mo ago
Yes, I did check that, but this isn’t about the status of Neon, it’s about the status of our account/databases. Bump
sensitive-blue
sensitive-blue16mo ago
There is nothing to do here except to do what Jorge said, but like I said, you will just be wasting your own compute time waking your database up. But let me check again if neonstatus has an API
curl -s https://neonstatus.com/aws-europe-frankfurt/api/v1/summary | jq
{
"page_title": "AWS - Europe (Frankfurt) - eu-central-1",
"page_url": "https://neonstatus.com/aws-europe-frankfurt",
"ongoing_incidents": [],
"in_progress_maintenances": [],
"scheduled_maintenances": []
}
curl -s https://neonstatus.com/aws-europe-frankfurt/api/v1/summary | jq
{
"page_title": "AWS - Europe (Frankfurt) - eu-central-1",
"page_url": "https://neonstatus.com/aws-europe-frankfurt",
"ongoing_incidents": [],
"in_progress_maintenances": [],
"scheduled_maintenances": []
}
But we don't guarantee that to work forever, like in the case we change status page providers This will also only tell you if there is an incident in your region. No guarantee your endpoint would be affected
correct-apricot
correct-apricotOP16mo ago
Roger that, thank you @Tristan Partin
robust-apricot
robust-apricot16mo ago
I believe you can use https://api-docs.neon.tech/reference/getprojectendpoint to check if the compute that you're using is in active state or not, but that might not be ideally the solution you're seeking.
No description
robust-apricot
robust-apricot16mo ago
What's the frequency you're aiming to check this for?
correct-apricot
correct-apricotOP16mo ago
Every 5 minutes seems OK because we’re not really concurrent right now (not a lot of MAU), but we may eventually need a every-30-seconds check.
robust-apricot
robust-apricot16mo ago
I see, and since you upgraded to Launch plan, did you change the auto suspend time to never?
No description
robust-apricot
robust-apricot16mo ago
I'm asking since per 30 seconds make about 2*60*24*30 = 86400 invocations per month, and trigger.dev offers about 200000 invocations in their free plan (as I understand from https://trigger.dev/pricing#computePricing) which you can leverage to check if the endpoint is up/down without waiting for the compute to wake up.
correct-apricot
correct-apricotOP16mo ago
Nope, it’s still auto suspend every 5 minutes because we’re not being hit a lot (at least not by real users)
robust-apricot
robust-apricot16mo ago
Ah I see, but you could still use the trigger.dev solution I shared, just that you'll be waking up your compute everytime you query it...
correct-apricot
correct-apricotOP16mo ago
Sounds interesting, I will test it out asap, thank you guys!

Did you find this page helpful?