this post was submitted on 19 Sep 2023
1135 points (98.8% liked)

Programmer Humor

32069 readers
422 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
1135
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 73 points 1 year ago (4 children)

I'm currently working with a client that doesn't have a health endpoint or any kind of monitoring on their new API . They say monitoring isn't needed because it will never go down.

Naturally it went down on day two. They still haven't added any "unnecessary" monitoring, insisting that it will never go down.

[–] [email protected] 43 points 1 year ago (1 children)

If you never know when it goes down to you it never goes down

Think smarter, not harder

[–] odium 17 points 1 year ago

Schrödinger's status

[–] [email protected] 30 points 1 year ago

This kind of hubris may be an opportunity for contractual fuckery...

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (2 children)

I never wrote an api that had a health system. Could you help me understand why that matters and how that helps ?

[–] [email protected] 32 points 1 year ago (1 children)

Just have an endpoint in your API (like /health) that doesn’t do anything but return “ok”.

So if your database goes down, your filesystem is full, etc, that endpoint will always return “ok” with HTTP 200. That way you can setup a ping monitoring service that will trigger an alarm if the process itself is down.

You of course need more pinging for the database server etc. But at least you know which service is down instead of “the whole website is down and we don’t know which parts”.

[–] SteveTech 10 points 1 year ago

Health checks are the only reason I've used 204 no content responses, so there's that too.

[–] [email protected] 2 points 1 year ago

That's because you don't write bugs. Health check are only needed when you're planning on having bugs in your system. Instead of doing monitoring I prefer to spend a bit more time fixing all the bugs and then my systems never break so no monitoring is needed. Of course the downside is lack of job security. They can fire me and the system will just continue running forever, no support needed. If you add some bugs they cannot fire you because someone needs to keep fixing the broken system.