Monitor the up/down status of local or remote HTTP endpoints. The HTTP check can detect bad response codes (e.g. 404), identify soon-to-expire SSL certificates, search responses for specific text, and much more. The check also submits HTTP response times as a metric.
The HTTP check is included in the Datadog Agent package, so you don’t need to install anything else on the servers from which you will probe your HTTP sites. Though many metrics-oriented checks are best run on the same host(s) as the monitored service, you may want to run this status-oriented check from hosts that do not run the monitored sites.
init_config: instances: - name: Example website url: https://example.com/ - name: Example website (staging) url: http://staging.example.com/
The HTTP check has more configuration options than many checks - many more than are shown above. Most options are opt-in, e.g. the Agent will not check SSL validation unless you configure the requisite options. Notably, the Agent will check for soon-to-expire SSL certificates by default.
This check runs on every run of the Agent collector, which defaults to every 15 seconds. To set a custom run frequency for this check, refer to the collection interval section of the custom check documentation.
See the sample http_check.d/conf.yaml for a full list and description of available options, here is a list of them:
|Name of your Http check instance. This is presented as a tag on the Service Checks.|
|The URL to test.|
|The time in seconds to allow for a response.|
|The HTTP method to use for the check.|
|Use this parameter to specify a body for a request with a POST, PUT, DELETE, or PATCH method. SOAP requests are supported if you use the POST method and supply an XML string as the data parameter.|
|This parameter allows you to send additional headers with the request. See the example YAML file for additional information and caveats.|
|A string or Python regular expression. The HTTP check searches for this value in the response and reports as DOWN if the string or expression is not found.|
|If your service uses basic authentication, you can provide the username and password here.|
|A string or Python regular expression for an HTTP status code. This check reports DOWN for any status code that does not match. This defaults to 1xx, 2xx and 3xx HTTP status codes. For example: |
|When set to |
|By default, the check collects the response time (in seconds) as the metric |
|Instructs the check to validate the TLS certificate of services when reaching to |
|This setting allows you to override the default certificate path as specified in |
|If set to |
|If set, the check will bypass proxy settings and attempt to reach the check url directly. This defaults to |
|This setting allows the service check to follow HTTP redirects and defaults to |
|A list of arbitrary tags that will be associated with the check. For more information about tags, see our Guide to tagging and blog post, The power of tagged metrics|
When you have finished configuring
http_check.d/conf.yaml, restart the Agent to begin sending HTTP service checks and response times to Datadog.
Run the Agent’s
status subcommand and look for
http_check under the Checks section.
|The response time of an HTTP request to a given url, tagged by url, e.g. 'url:http://example.com'.|
Shown as second
|Whether the check can connect, 1 if true, 0 otherwise. Tagged by url, e.g. 'url:http://example.com'.|
|Whether the check failed to connect, 1 if true, 0 otherwise. Tagged by url, e.g. 'url:http://example.com'.|
|Days until SSL certificate expiration|
Shown as day
|Seconds until SSL certificate expiration|
Shown as second
The HTTP check does not include any events.
Returns CRITICAL if the Agent cannot establish an HTTP connection to the URL. Returns OK if the connection is successful.
Statuses: ok, critical
Returns CRITICAL if the SSL certificate has expired. Returns WARNING if the SSL certificate will expire in less than the configured threshold. Returns OK otherwise.
Statuses: ok, warning, critical, unknown
check_certificate_expiration to false.
Need help? Contact Datadog support.