valeriansaliou / vigil

🚦 Microservices Status Page. Monitors a distributed infrastructure and sends alerts (Slack, SMS, etc.).

Home Page:https://crates.io/crates/vigil-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

poll_http_status_healthy_above & poll_http_status_healthy_below not working ?

mathieudebrito opened this issue · comments

Hi guys !

I use poll_http_status_healthy_below & poll_http_status_healthy_above to check for a 401 to be the right response status for my-website.com. (my-website.com is protected behind an .htaccess, that's why I look for a 401)

Here is my config file :

[[probe.service.node]]
id = "my-website.com"
label = "my-website.com"
mode = "poll"
poll_http_status_healthy_above = 400
poll_http_status_healthy_below = 403
replicas = ["https://my-website.com/"]

Vigil logs are :

pooling idle connection for ("https", my-website.com) 
(DEBUG) - response '401 Unauthorized' for https://my-website.com/?1631287140
(DEBUG) - prober poll result received for http target: https://my-website.com/?1631287140 with status: 401
(DEBUG) - will probe replica: HTTPS("https://my-website.com/") with retry count: 2
(DEBUG) - prober poll will fire for http target: https://my-website.com/?1631287140 with method: Head and body: ''
(DEBUG) - reuse idle connection for ("https", my-website.com) 
(DEBUG) - flushed 121 bytes 
(DEBUG) - parsed 5 headers 
(DEBUG) - incoming body is empty 
(DEBUG) - pooling idle connection for ("https", my-website.com) 
(DEBUG) - response '401 Unauthorized' for https://my-website.com/?1631287140
(DEBUG) - prober poll result received for http target: https://my-website.com/?1631287140 with status: 401
(DEBUG) - replica probe result: sites:my-website.com:https://my-website.com/ => Dead

And my status page is show red as you can imagine.
Is it a bug on your side ? Or did I miss a specific setting ?
I followed the documentation.

Best regards,
Sincerely

Hello,

By default, Vigil performs an HTTP HEAD. Your server probably does not respond with the same status code for HTTP HEAD requests.

You can try forcing an HTTP GET by adding, just below your other http_ configurations, the following rule:

http_method = "GET"

Let me know if that works.

Ah snap sorry, forgot about these ones, what defines an healthy status code should go in the common "metrics" section, see:

https://github.com/valeriansaliou/vigil/blob/master/config.cfg#L36

Those cannot be configured per-node. http_method, though, should go within the [[probe.service.node]] section.

Vigil does not panic if you enter extraneous configuration keys somewhere, it only panics if it recognizes a key and its format is invalid, or the key is not set when it is required.