New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/matomo.php always returns 200 OK #18851
Comments
HI @MrIsak |
Hi @sgiehl, I (from a IT-admin POV), rather get a notification from our surveillance system that something is wrong, than hiding an error in the visitors browser console; which they probably won't notice. As I see it, there is two alternative:
If you still think alternativ 1. is the way to go, how do you recommend we monitor the HTTP-tracking API? |
@MrIsak Which documentation are you referring to? @tsteur what do you think of this? |
@sgiehl https://matomo.org/faq/how-to/faq_20278/ Looking for a specifik string in the response is one way to go. Even though I personally prefer a correct statuscode, since the possibility of string match/not match varies between different loadbalancers. |
The FAQ would need to be updated. The In case you are wanting to use this for health checks for a load balancer, then you could
In case you are a bit familiar with PHP, another way could be to create a simple plugin that provides an endpoint and checks the DB connection and if it fails then it would return eg an HTTP 503. The endpoint could also check if there's disk space available. We could rename the issue to have a feature to provide an endpoint for health checks? Although I would assume that the URL mentioned to request the Matomo version could already work for this purpose. |
Expected Behavior
When databas is down /matomo.php should return 503, since service is not operational.
Current Behavior
FAQ says, to monitor the "HTTP Tracker API: request to /matomo.php should return http status code 200"
It does.... all the time. Even when database is down, and not able to handle incoming data.
Ref:https://matomo.org/faq/how-to/faq_20278/
Steps to Reproduce (for Bugs)
HTTP/1.1 200 OK
HTTP/1.1 200 OK
Context
When using loadbalancer/ssl-offloader/proxys, monitoring endpoints is crucial. Using /matomo.php is not reliable for the Tracker API as stated in FAQ.
When DB is down, clients will get a 400 error. But since matomo.php still reply with HTTP 200, loadbalancer will still send traffic to that broken endpoint.
Your Environment
The text was updated successfully, but these errors were encountered: