alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.01k stars 774 forks source link

Add a static html page or a status page for monitoring #100

Closed CodeBrauer closed 5 years ago

CodeBrauer commented 5 years ago

We want to monitor our service - and currently we just use a render of an small page as screenshot with a tiny viewport. Of cause if our monitoring interval is short, we use a lot of performance..

Due there is no other route that responses a HTTP 200 code, we can't monitor it well.

How about adding a static html route so wen can check the service is active? Or even maybe better: A page that shows health (like is puppeteer working, last errors etc.)?

kimmobrunfeldt commented 5 years ago

This is a great question. If I remember correctly, we also setup an internal monitoring so that we render our company's website with the url-to-pdf-api. This also then tests that the actual rendering works. I think this should be suitable for many monitoring cases. In our architecture, the responsible party for sending more advanced alerts is our order service, which will then report if invoice can't be generated (url-to-pdf-api responses non-200).

Closing this for now. I don't want to add a new endpoint for this unless more people have the need. Thanks!

pschirch commented 4 years ago

@CodeBrauer @kimmobrunfeldt

In times of containers respectively pods, it should be possible for each service to provide some basic information about whether or not it can accept requests, with the help of a simple status page. This status page can easily used to configure a liveness probe and or a readiness probe without manually tinker and adding some scripts for it.