Skip to main content

HTTP metrics

This page lists all metrics exported by the HTTP probe. These metrics are available for every scrape cycle and can be forwarded to any configured exporter.

Labels

Every HTTP metric is exported with the following labels.

LabelDescription
instanceThe target URL being probed (e.g. https://www.google.com)
probeAlways http
custom labelsAny labels defined in the target configuration (e.g. service, env)

Availability metrics

These metrics indicate whether the probe reached the target and whether the response matched the expected outcome.

MetricTypeDescription
upGauge1 if the TCP connection to the target succeeded, 0 otherwise
successGauge1 if the HTTP status code matches expected_status_code, 0 otherwise
status_codeGaugeThe HTTP response status code returned by the target (e.g. 200, 404, 500)

Timing metrics

These metrics break down the end-to-end request duration into individual phases.

MetricTypeUnitDescription
dns_duration_msGaugemsTime taken to resolve the target hostname via DNS
tcp_connect_duration_msGaugemsTime taken to establish the TCP connection
time_to_first_byte_msGaugemsTime from sending the request to receiving the first byte of the response (TTFB)
content_transfer_duration_msGaugemsTime to fully download the response body
total_duration_msGaugemsTotal end-to-end duration of the probe
http_duration_msGaugemsAlias of total_duration_ms, retained for backwards compatibility

TLS metrics

These metrics are only exported when the target uses HTTPS and the TLS handshake completes successfully.

MetricTypeUnitDescription
tls_handshake_msGaugemsTime taken to complete the TLS handshake
cert_expiration_tsGaugeUnix timestamp (s)Certificate expiry date as a Unix epoch timestamp
cert_begin_tsGaugeUnix timestamp (s)Certificate start-of-validity date as a Unix epoch timestamp

Use cert_expiration_ts to build Grafana alerts that notify you before a certificate expires.

Example output

The following example shows a typical set of metrics exported after a successful HTTPS probe.

up{instance="https://www.google.com", probe="http", service="google", env="prod"} 1
success{instance="https://www.google.com", probe="http", service="google", env="prod"} 1
status_code{instance="https://www.google.com", probe="http", service="google", env="prod"} 200
dns_duration_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 12
tcp_connect_duration_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 8
tls_handshake_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 35
time_to_first_byte_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 78
content_transfer_duration_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 4
total_duration_ms{instance="https://www.google.com", probe="http", service="google", env="prod"} 137
cert_expiration_ts{instance="https://www.google.com", probe="http", service="google", env="prod"} 1767225600
cert_begin_ts{instance="https://www.google.com", probe="http", service="google", env="prod"} 1759363200