Menu
Grafana Cloud

Multi-HTTP

Note: This is a public preview and it’s still subject to changes.

MultiHTTP checks are used to test websites. Uptime and response latency are measured like other check types. Unlike HTTP checks, MultiHTTP checks can send multiple HTTP requests to different URLs within a single check. It’s also possible to use the results of one request in a later one, and make several assertions for each request.

Options

For each invidual request in a MultiHTTP check it’s possible to have the following options:

Option nameDescription
Request targetThe URL to send a request to
Request methodThe HTTP method to use when sending the request
HeadersName and value of HTTP headers to add to the request
Query parametersName and value of URL query parameters
AssertionsSee below
VariablesSee below

These configuration options do not produce any additional labels in the resulting metrics.

Assertions

There are four types of assertions.

Text assertions

Text assertions match a simple string against various subjects:

  • Body: the entire response body is used
  • Headers: each individual header is matched against the specified value. The header name is lower-cased, followed by a colon and a space (: ), followed by the header’s value (as is). The match succeeds if at least one of the headers matches.
  • Status code: the status code is used

The match can be performed against the specified subject in one of several ways:

  • Contains: the specified value must be present somewhere in the subject.
  • Does not contain: the specified value must not be present anywhere in the subject.
  • Equals: the subject must be exactly equal to the specified value.
  • Starts with: the subject must start with the specified value.
  • Ends with: the subject must end with the specified value.

JSON path value assertions

This type of assertion expects the response body to be a JSON document and it accepts a JSONPath expression to be matched against the specified value. The possible matches are:

  • Contains: the specified value must be present somewhere in the result of evaluating the JSONPath expression.
  • Does not contain: the specified value must not be present anywhere in the result of evaluating the JSONPath expression.
  • Equals: the result of evaluating the JSONPath expression must be exactly equal to the specified value.
  • Starts with: the result of evaluating the JSONPath expression must start with the specified value.
  • Ends with: the result of evaluating the JSONPath expression must end with the specified value.

JSON path assertions

This type of assertion expects the response body to be a JSON document and it accepts a JSONPath expression that must evaluate to a non-empty result for the assertion to succeed.

Regex assertions

Regular expression assertions match evaluate the provided regex against one of various subjects:

  • Body: the entire response body is used
  • Headers: each individual header is evaluated against the specified regex. The header name is lower-cased, followed by a colon and a space (: ), followed by the header’s value (as is). The match succeeds if at least one of the headers matches.
  • Status code: the status code is used

Variables

Variables offer the possibility to capture values from the responses to individual HTTP requests. Each variable must be named, and the name must be unique across all requests. The name can be used in subsequent requests by writing ${name}. It’s possible to use this anywhere where a string is expected, for example as the value of a header or the value of an assertion.

Variable values can be obtained from the following.

  • A JSONPath: the value of the variable is the result of evaluating the JSONPath expression.
  • A regular expression: the value of the variable is the string matching the regular expression.
  • A CSS selector: the value of the variable is the value of evaluating the CSS selector against the response body. Optionally, an attribute name can be specified, in which case the value of the variable is the value of the specified attribute.

Metrics

Metric nameDescription
probe_all_duration_secondsReturns how long the probe took to complete in seconds (histogram)
probe_all_successDisplays whether or not the probe was a success (summary)
probe_data_received_bytesThe total number of bytes received
probe_data_sent_bytesThe total number of bytes sent
probe_duration_secondsReturns how long the probe took to complete in seconds
probe_http_duration_secondsFor each method and URL group, its duration in seconds, split by phase (resolve, connect, tls, processing, transfer)
probe_http_infoInformation about the response
probe_http_requests_failed_totalThe number of failed requests by method and URL
probe_http_requests_totalThe total number of requests by method and URL
probe_http_sslFor each method and URL group, whether or not the request used SSL
probe_http_status_codeFor each method and URL group, the respone code for the request
probe_http_versionFor each method and URL group, the version of the HTTP procotol used to complete the request
probe_iteration_duration_secondsThe total number of seconds for the whole check, excluding setup time for the check itself
probe_successDisplays whether or not the probe was a success
sm_check_infoProvides information about a single check configuration