Skip to main content
The HTTP Check integration requires CXDOT Collector 1.4.0 or greater. Hypertext Transfer Protocol (HTTP) is the protocol clients use to request resources over the web. Use the HTTP Check CXDOT Collector integration with the CXDOT Collector to collect availability, response time, and certificate expiry metrics from the HTTP and HTTPS endpoints your services depend on. The HTTP Check CXDOT Collector integration supports HTTP and HTTPS URLs.

Supported telemetry types

The HTTP Check CXDOT Collector integration supports these telemetry types:

Prerequisites

The HTTP Check CXDOT Collector integration has the following prerequisites:
  • Make each URL you want to monitor reachable from the CXDOT Collector.

Configure

The HTTP Check integration is enabled by default. You can configure targets either by annotating pods in your Kubernetes cluster or by listing static endpoints in your Helm values. To configure the integration, follow these steps:
  1. To monitor a URL served by a pod in Kubernetes, such as its readiness endpoint, add a CXDOT integration annotation to the pod template. The annotation key must end with the container name. For example, add the following annotation to your workload:
    The Collector replaces ${target.host} with the pod IP address and ${target.port.http} with the container port named http.
  2. Optional: To monitor URLs that pods in your cluster don’t serve, such as an API outside your Kubernetes cluster, configure static targets. For example, add the following to the values.yaml file for your CXDOT Collector Helm chart:
    The integration instance requests only the listed URLs and doesn’t discover annotated targets. In Kubernetes mode, the cluster Collector monitors static targets. For more information, see architecture.
  3. Optional: Name a static target. The Collector adds the name to every time series from the target as the cxdot.integration.target.name attribute. For example, add the following to the values.yaml file for your CXDOT Collector Helm chart:
    A target found from a Datadog http_check annotation takes the name from the instance’s name setting.
  4. Optional: Trust a private certificate authority for static HTTPS targets. Mount the authority’s certificate with the chart’s clusterCollector.extraVolumes and clusterCollector.extraVolumeMounts values, then set tls.ca_file to the mounted path. For example, add the following to the values.yaml file for your CXDOT Collector Helm chart:
    The tls settings apply to every static target.
  5. Optional: Configure separate integration instances to monitor both annotated pods and static targets. For example, add the following to the values.yaml file for your CXDOT Collector Helm chart:
    The http_check/external key defines a named instance for the static targets. Configuring a named instance suppresses the implicit default instance, so the empty http_check: {} entry is required to keep discovering annotated pods.
  6. Optional: Disable the integration to stop monitoring annotated targets. For example, add the following to the values.yaml file for your CXDOT Collector Helm chart:
Metrics from each discovered pod include that pod’s Kubernetes metadata. For more information, see autodiscovery.

Validate

To validate the HTTP Check CXDOT Collector integration, follow these steps:
  1. In the Live Telemetry Analyzer, add the following filters:
    • __name__=cxdot.integration.target.health
    • cxdot.integration.name=http_check
    Confirm that one time series appears for each configured URL, identified by the cxdot.integration.target attribute.
  2. In Metrics Explorer, run the following query:
    Confirm that each reachable URL reports 1 and each unreachable URL reports 0.
  3. In Metrics Explorer, run the following query:
    Confirm that the query returns the response time in milliseconds for each reachable URL.

Troubleshooting

  • A URL reports 0 for cxdot.integration.target.health: In Metrics Explorer, run the following query to group recent failed checks by URL and failure class:
    The error.message attribute identifies whether the request timed out, failed DNS lookup, was refused, failed TLS negotiation, or failed for another reason.
  • A URL reports 0 for cxdot.integration.target.health but has no httpcheck.error failures: The response arrived but didn’t meet the endpoint’s conditions. Check httpcheck.status for a status code that expected_status doesn’t accept. When expected_status is unset, a status code of 400 or higher fails. To find failed validations, run the following query:

Configuration reference

Configure one HTTP Check integration instance with the following settings. In Helm values, place these settings under collection.cxdot.integrations.http_check. In a Collector configuration file, place them under cxdot.integrations.http_check.

Optional settings

  • enabled Type: boolean. Optional. Default: true. Whether to enable this HTTP Check integration instance. If true, the Collector monitors the configured URLs. If false, it doesn’t run this integration instance.
  • endpoints Type: array of object. Optional. Default: []. URLs to monitor. The Collector requests each entry on its own schedule and reports it as a separate target.
  • endpoints[].name Type: string. Optional. Minimum length: 1. Name for this URL, added to every time series from it as the cxdot.integration.target.name attribute. For example, admin. A target found from a Datadog http_check annotation takes the instance’s name, spelled as Datadog’s instance tag spells it.
  • endpoints[].endpoint Type: string. Required. URL to request, including the http or https scheme. For example, https://api.example.com/healthz. An HTTPS URL also reports the number of seconds until its server certificate expires.
  • endpoints[].method Type: string. Optional. Default: GET. HTTP method for the request.
  • endpoints[].headers Type: object. Optional. Default: {}. Additional request headers as name-value pairs. Set the Host header to request a virtual host by its network address.
  • endpoints[].proxy_url Type: string. Optional. Proxy URL for this endpoint, for example http://proxy.example.com:8080. When unset, the Collector uses the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables.
  • endpoints[].username Type: string. Optional. Username for HTTP basic authentication to this endpoint. When username or password is set, the credentials replace any Authorization header in headers.
  • endpoints[].password Type: string. Optional. Password for HTTP basic authentication to this endpoint. The Collector masks this value in diagnostic output, logs, and errors.
  • endpoints[].expected_status Type: regex or integer. Optional. Go regular expression for the response status codes that count as healthy, matched against the whole three-digit code. For example, 403 accepts only a 403, and [23]\d\d accepts any 2xx or 3xx response. When unset, a status code lower than 400 is healthy.
  • endpoints[].validations Type: array of object. Optional. Default: []. Conditions the response body must meet. The endpoint is healthy only when the response meets every condition, and a condition that looks for content fails on an empty body. An entry can set several conditions.
  • endpoints[].validations[].contains Type: string. Optional. Minimum length: 1. Text the response body must contain.
  • endpoints[].validations[].not_contains Type: string. Optional. Minimum length: 1. Text the response body must not contain.
  • endpoints[].validations[].regex Type: regex. Optional. Minimum length: 1. Go regular expression the response body must match somewhere. For example, "status":\s*"ok".
  • endpoints[].validations[].not_regex Type: regex. Optional. Minimum length: 1. Go regular expression the response body must not match anywhere.
  • endpoints[].validations[].json_path Type: string. Optional. Minimum length: 1. Path to a value that must exist in a JSON response body, in GJSON path syntax. For example, checks.database.status.
  • endpoints[].validations[].equals Type: string. Optional. Minimum length: 1. Text the value at json_path must equal.
  • endpoints[].validations[].min_size Type: integer. Optional. Minimum: 0. Smallest acceptable response body size, in bytes.
  • endpoints[].validations[].max_size Type: integer. Optional. Minimum: 0. Largest acceptable response body size, in bytes.
  • collection_interval Type: duration. Optional. Default: 15s. How often the Collector requests each URL. Every collection performs an HTTP request against the target.
  • timeout Type: duration. Optional. Default: 10s. Maximum time the Collector waits for each HTTP request to complete.
  • tls Type: object. Optional. TLS settings for all HTTPS endpoints in endpoints. Certificate verification is enabled unless insecure_skip_verify is true. Targets found from annotations use the annotation’s TLS settings.
  • tls.ca_file Type: string. Optional. Path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA. (optional)
  • tls.ca_pem Type: string. Optional. In memory PEM encoded cert. (optional)
  • tls.cert_file Type: string. Optional. Path to the TLS cert to use for TLS required connections. (optional)
  • tls.cert_pem Type: string. Optional. In memory PEM encoded TLS cert to use for TLS required connections. (optional)
  • tls.cipher_suites Type: array of string. Optional. CipherSuites is a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
  • tls.curve_preferences Type: array of string. Optional. contains the elliptic curves that will be used in an ECDHE handshake, in preference order Defaults to empty list and “crypto/tls” defaults are used, internally.
  • tls.include_system_ca_certs_pool Type: boolean. Optional. If true, load system CA certificates pool in addition to the certificates configured in this struct.
  • tls.insecure Type: boolean. Optional. In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false)
  • tls.insecure_skip_verify Type: boolean. Optional. InsecureSkipVerify will enable TLS but not verify the certificate.
  • tls.key_file Type: string. Optional. Path to the TLS key to use for TLS required connections. (optional)
  • tls.key_pem Type: string. Optional. In memory PEM encoded TLS key to use for TLS required connections. (optional)
  • tls.max_version Type: string. Optional. MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional)
  • tls.min_version Type: string. Optional. MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional)
  • tls.reload_interval Type: duration. Optional. ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional)
  • tls.server_name_override Type: string. Optional. ServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)
  • tls.tpm Type: object. Optional. Trusted platform module configuration
  • tls.tpm.auth Type: string. Optional. Authorization value for the trusted platform module key.
  • tls.tpm.enabled Type: boolean. Optional. Whether to use a trusted platform module for the TLS private key. If true, the Collector loads the key from the configured device or socket. If false, the Collector uses the configured key file or in-memory key.
  • tls.tpm.owner_auth Type: string. Optional. Owner authorization value for the trusted platform module.
  • tls.tpm.path Type: string. Optional. The path to the TPM device or Unix domain socket. For instance /dev/tpm0 or /dev/tpmrm0.