deadtrickster / prometheus-cowboy

Expose Prometheus metrics using cowboy/cowboy2
MIT License
21 stars 20 forks source link

squash! Accept binary status codes #5

Closed maxmellen closed 5 years ago

maxmellen commented 5 years ago

This PR amends https://github.com/deadtrickster/prometheus-cowboy/pull/4

After running the code for a bit, I realised that it is the status_class value that caused problems with binary status codes, not status.

I should've looked into it more before submitting the last PR. Sorry about that.

deadtrickster commented 5 years ago

while we are on it, can you share your binary status_classes (don't remember using/seeing them myself)? maybe we can just derive something from them. not just ignore?

maxmellen commented 5 years ago

So in this case, I'm getting an error from 208 Already Reported which should be the success class. The thing is, since it is part of the WebDAV extension to HTTP, it didn't get support as a normal status code in cowboy yet, although I brought it up and it should be treated normally soon. That issue is being tracked there https://github.com/ninenines/cowlib/pull/79

Then for anyone who would want to really use a completely arbitrary status code, it would make sense for it to be classified as undefined.