Skip to main content

Httpcheck Receiver

Status Available in: contrib, k8s Maintainers: @VenuEmmadi Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

This receiver will make a request to the specified endpoint using the configured method. This scraper generates a metric with a label for each HTTP response status class with a value of 1 if the status code matches the class. For example, the following metrics will be generated if the endpoint returned a 200:
For HTTPS endpoints, the receiver can collect TLS certificate metrics including the time remaining until certificate expiry. This allows monitoring of certificate expiration alongside HTTP availability. Note that TLS certificate metrics are disabled by default and must be explicitly enabled in the metrics configuration.

Configuration

Note: This receiver was renamed from httpcheck to http_check to match the snake_case naming convention. The deprecated component type httpcheck is still accepted as an alias and will log a deprecation warning.
The following configuration settings are available:
  • targets (required): The list of targets to be monitored.
  • collection_interval (optional, default = 60s): This receiver collects metrics on an interval. Valid time units are ns, us (or µs), ms, s, m, h.
  • initial_delay (optional, default = 1s): defines how long this receiver waits before starting.
Each target has the following properties:
  • endpoint (optional): A single URL to be monitored.
  • endpoints (optional): A list of URLs to be monitored.
  • method (optional, default: GET): The HTTP method used to call the endpoint or endpoints.
  • body (optional): Request body content for POST, PUT, PATCH, and other methods.
At least one of endpoint or endpoints must be specified. Additionally, each target supports the client configuration options of confighttp.

Optional Metrics

The receiver provides optional metrics that are disabled by default and can be enabled in the configuration:

TLS Certificate Monitoring

For HTTPS endpoints, TLS certificate metrics can be enabled:

Timing Breakdown Metrics

For detailed performance analysis, timing breakdown metrics are available:
These metrics provide detailed timing information for different phases of the HTTP request:
  • dns.lookup.duration: Time spent performing DNS lookup
  • client.connection.duration: Time spent establishing TCP connection
  • tls.handshake.duration: Time spent performing TLS handshake (HTTPS only)
  • client.request.duration: Time spent sending the HTTP request
  • response.duration: Time spent receiving the HTTP response

Response Validation Metrics

For API monitoring and health checks, response validation metrics are available:
These metrics track validation results with validation.type attribute indicating the validation type (contains, json_path, size, regex).

Request Body Support

The receiver supports sending request bodies for POST, PUT, PATCH, and other HTTP methods:
Content-Type Auto-Detection:
  • JSON bodies (starting with { or [): application/json
  • Form data (containing =): application/x-www-form-urlencoded
  • Other content: text/plain
  • Custom headers override auto-detection

Response Validation

The receiver supports response body validation for API monitoring:
Validation Types:
  • contains / not_contains: String matching
  • json_path + equals: JSON path queries using gjson syntax
  • max_size / min_size: Response body size limits
  • regex: Regular expression matching

Example Configuration

Metrics

Details about the metrics produced by this receiver can be found in documentation.md

Metrics

Attributes


Last generated: 2026-08-24