patternMinor
Health monitoring of web pages without using GET check
Viewed 0 times
withoutcheckmonitoringgethealthusingwebpages
Problem
I am looking for a solution to monitor the health (
Let's say I have three services,
Now, what I can do is that I can create a
DOWN or UP) of my web pages.Let's say I have three services,
site.com/data
site.com/user
site.com/idNow, what I can do is that I can create a
GET request which will be served every second and check if response status code is 200 OK. If it is anything else than 200 OK, then it will trigger an alert. But, I don't want to hit the server continuously, as it will create unnecessary logs. I am using a mongodb logger. What is the recommended way to achieve this?Solution
I see two way to solve this problem:
-
Check your logs often and ensure there was an access with code 200 in the last N seconds/minutes and no code 5xx meaning there's a server side error. (the often should be coherent with how long you are ok with no entries)
-
Keep an active check but:
Depending on how often your sites are called you may wish to mix both methods to have a proper check even if there's no traffic from real clients.
-
Check your logs often and ensure there was an access with code 200 in the last N seconds/minutes and no code 5xx meaning there's a server side error. (the often should be coherent with how long you are ok with no entries)
-
Keep an active check but:
- use a HEAD request (so there's less data to return by the server)
- use a custom user agent for the check
- configure your log exporter to ignore this user agent.
- take a larger check interval, 1 second is probably over obsessive
Depending on how often your sites are called you may wish to mix both methods to have a proper check even if there's no traffic from real clients.
Context
StackExchange DevOps Q#4263, answer score: 5
Revisions (0)
No revisions yet.