Httpcheck Receiver
contrib, k8s
Maintainers: @VenuEmmadi
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
This receiver will make a request to the specifiedendpoint 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:
Configuration
Note: This receiver was renamed fromThe following configuration settings are available:httpchecktohttp_checkto match the snake_case naming convention. The deprecated component typehttpcheckis still accepted as an alias and will log a deprecation warning.
targets(required): The list of targets to be monitored.collection_interval(optional, default =60s): This receiver collects metrics on an interval. Valid time units arens,us(orµs),ms,s,m,h.initial_delay(optional, default =1s): defines how long this receiver waits before starting.
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.
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:dns.lookup.duration: Time spent performing DNS lookupclient.connection.duration: Time spent establishing TCP connectiontls.handshake.duration: Time spent performing TLS handshake (HTTPS only)client.request.duration: Time spent sending the HTTP requestresponse.duration: Time spent receiving the HTTP response
Response Validation Metrics
For API monitoring and health checks, response validation metrics are available: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:- 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:contains/not_contains: String matchingjson_path+equals: JSON path queries using gjson syntaxmax_size/min_size: Response body size limitsregex: Regular expression matching
Example Configuration
Metrics
Details about the metrics produced by this receiver can be found in documentation.mdMetrics
| Metric Name | Description | Unit | Type | Attributes |
|---|---|---|---|---|
❌ httpcheck.client.connection.duration | Time spent establishing TCP connection to the endpoint. | ms | Gauge | http.url, network.transport |
❌ httpcheck.client.request.duration | Time spent sending the HTTP request to the endpoint. | ms | Gauge | http.url |
❌ httpcheck.dns.lookup.duration | Time spent performing DNS lookup for the endpoint. | ms | Gauge | http.url |
✅ httpcheck.duration | Measures the duration of the HTTP check. | ms | Gauge | http.url |
✅ httpcheck.error | Records errors occurring during HTTP check. | {error} | UpDownCounter | http.url, error.message |
❌ httpcheck.response.duration | Time spent receiving the HTTP response from the endpoint. | ms | Gauge | http.url |
❌ httpcheck.response.size | Size of response body in bytes. | By | Gauge | http.url |
✅ httpcheck.status | 1 if the check resulted in status_code matching the status_class, otherwise 0. | 1 | UpDownCounter | http.url, http.status_code, http.method, http.status_class |
❌ httpcheck.tls.cert_remaining | Time in seconds until certificate expiry, as specified by NotAfter field in the x.509 certificate. Negative values represent time in seconds since expiration. | s | Gauge | http.url, http.tls.issuer, http.tls.cn, http.tls.san |
❌ httpcheck.tls.handshake.duration | Time spent performing TLS handshake with the endpoint. | ms | Gauge | http.url |
❌ httpcheck.validation.failed | Number of response validations that failed. | {validation} | UpDownCounter | http.url, validation.type |
❌ httpcheck.validation.passed | Number of response validations that passed. | {validation} | UpDownCounter | http.url, validation.type |
Attributes
| Attribute Name | Description | Type | Values |
|---|---|---|---|
error.message | Error message recorded during check | string | |
http.method | HTTP request method | string | |
http.status_class | HTTP response status class | string | |
http.status_code | HTTP response status code | int | |
http.tls.cn | The commonName in the subject of the certificate. | string | |
http.tls.issuer | The entity that issued the certificate. | string | |
http.tls.san | The Subject Alternative Name of the certificate. | slice | |
http.url | Full HTTP request URL. | string | |
network.transport | OSI transport layer or inter-process communication method. | string | |
validation.type | Type of validation performed (contains, json_path, size, regex) | string |
Last generated: 2026-04-13