> ## Documentation Index
> Fetch the complete documentation index at: https://docs.use.observer/llms.txt
> Use this file to discover all available pages before exploring further.

# Test a check before saving

> Run a check once through its Observer Agent from the metric form, and see the value, status, latency and reason it would report. Nothing is saved.

The metric form can run a check once, with the settings you have
entered, before you save it. The test runs on the metric's selected
Observer Agent, from your network and with the agent's own credentials,
so it sees what the saved check will see. Nothing is saved and the
metric's status does not change.

<Info>
  Testing through an agent needs agent version **1.7.0** or later. Older
  agents keep working; only the test is unavailable through them.
</Info>

## Run a test

In the metric form, under the source settings, select **Test check**, then
**Run test**. The test uses the agent chosen under **Schedule**.

**Test check** is available for these sources: Prometheus, HTTP, TCP,
DNS, ICMP, TLS certificate, gRPC, WebSocket, database, CloudWatch, Loki
and Elasticsearch. It is not available for custom probes, OTLP, manual
metrics or heartbeats.

For an HTTP check with a JSON path, **Test extraction** runs the request
once and shows the number the path extracts. It is enabled once the URL
and the JSON path are set.

## What comes back

A test returns four things:

| Field | Meaning |
| - | - |
| Value | The number the check read, or none. |
| Status | Healthy, degraded or unhealthy, from the thresholds in the form. When a threshold is missing, the form shows only the value. |
| Latency | How long the test took, in milliseconds. |
| Reason | A short reason code when there is no value, for example a timeout or an unexpected HTTP status. |

A test through an agent never returns query rows, response bodies,
headers, log lines or error messages. Error messages from drivers can
contain connection strings or tokens, so the agent sends only a reason
code. Secret references (`*_ref` fields) are resolved on the agent host
and never leave it.

## States

| State | What it means |
| - | - |
| Queued | The test is waiting for the agent to pick it up. Agents check for work every few seconds. |
| Running | The agent is running the check. |
| Done | The result is shown, with a line saying which agent ran it. |
| Timed out | The agent did not answer within 60 seconds. Check it is running and can reach Observer, then try again. A single test on the agent stops after 30 seconds. |
| Can't test right now | The test cannot go through the agent. The form says why (below). |

A test cannot go through the agent when:

* no agent is selected for the metric;
* the agent is **offline**: no heartbeat in the last 90 seconds;
* the agent has not connected yet;
* the agent's key is revoked;
* the agent is **outdated**: it runs a version older than 1.7.0. Update
  the agent to test through it, or save the metric and watch its first
  sample.

## Fallback for public HTTP URLs

When the agent cannot run the test, an **HTTP** check whose URL is public
is tested once from Observer instead. The result says it ran from
Observer's servers, and it can differ from what your agent sees.

* Only public addresses are reached. Private, internal and loopback
  addresses are refused, and every redirect is checked again. A private
  URL can only be tested through an online agent.
* Secret headers (`header_refs`) are resolved by the agent from its
  environment variables, so they are not sent. The result names the
  headers that were left out.
* Other source types have no fallback: they are tested only through the
  agent.

**Test extraction** from Observer also shows the HTTP status code and a
preview of the start of the public response, so you can adjust the JSON
path. Through an agent, only the extracted number comes back and there
is no preview.

## Limits

* Up to 30 tests per minute per organization through agents, and up to
  20 waiting tests per agent.
* Up to 20 tests per minute per organization from Observer.

When a limit is reached, the form says to wait a minute and try again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.