macbre / phantomas

Headless Chromium-based web performance metrics collector and monitoring tool
https://www.npmjs.com/package/phantomas
BSD 2-Clause "Simplified" License
2.26k stars 141 forks source link

Monitoring error pages #1205

Open ldevernay opened 2 years ago

ldevernay commented 2 years ago

Hi, As of today, it is difficult to monitor 404 error pages because they are handled as errors, which prevents metrics from being gathered and some best practices from being checked. However, it could be really interesting to monitor error pages, as stated in this article from Matt Hobbs : https://nooshu.com/blog/2020/08/25/you-should-be-testing-your-404-pages-web-performance/

Do you think it would be possible?

macbre commented 2 years ago

@ldevernay, great idea!

macbre commented 2 years ago

@ldevernay, how does a command line option --validate-all-response-codes sounds to you? It will cause all metrics to be returned instead of returning an error due to non-200 response code.

I'm open for discussing the naming here ;)


Inspired a bit by https://github.com/axios/axios/issues/41 and https://axios-http.com/docs/handling_errors.

ldevernay commented 2 years ago

Hi @macbre, Thanks for this quick and thorough answer! I will check with the rest of the team and let you know but this sounds great.

ldevernay commented 2 years ago

OK, that was fast : as soon as you implement this option, I confirm that we can use this on our side and it might solve our issue with 404 pages (and apparently other error pages as well). Regarding the naming for the option, I get your point but can't find anything better for now. I think --validate-all-response-codes is clear enough.

macbre commented 2 years ago

Great! Will work on that.

Similar: #809 and #823

ldevernay commented 2 years ago

Awesome, thx!