Answer the question
In order to leave comments, you need to log in
How to make alerts by response code in Datadog?
Hello. Need help. I want to make alarms if the site gives 401 502 and so on, errors. There is an agent on the wheelbarrow who sends various things to the datadog. There is such a http_check module, and it seems to have such a function.
http_response_status_code - A string or Python regular expression for an HTTP status code. This check will report DOWN for any status code that does not match. This defaults to 1xx, 2xx and 3xx HTTP status codes. For example: 401 or 4\d\d.
init_config:
instances:
- name: My first service
url: https://example.com
collect_response_time: true
timeout: 1
skip_event: true
http_response_status_code: 502
check_certificate_expiration: true
disable_ssl_validation: false
days_warning: 7
days_critical: 3
tags:
- url:example.com
- env:production
Answer the question
In order to leave comments, you need to log in
Actually the answer is this. These assholes know the check doesn't work. Therefore it is necessary to use custom check. For example this http_check.py
Next, we restart the agent and simulate any error, and see the message in events
example.com returned a status of 503 after 30.0 seconds
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question