Skip to main content
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.
Testing through an agent needs agent version 1.7.0 or later. Older agents keep working; only the test is unavailable through them.

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, Elasticsearch and host. It is not available for custom probes, OTLP, manual metrics, heartbeats or inbound alerts. 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: 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

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.

Test through the API

POST /metrics/test runs the same test without the console, and the MCP tool testProbe calls it. Send the source_type and source_config a metric would have, the agent_id of an online agent, and optionally the four threshold fields. The key needs write:metrics or write:config.
  • unit is the unit of value (ms, %, days, s, B/s), or null for a bare number such as a query result. Use it to pick thresholds before you create the metric. See Probe types for the unit of each source.
  • status is null unless all four threshold fields are given.
  • With no value, reason, reason_label and reason_hint explain why. See Reason codes.
  • The request waits up to wait_seconds (default and maximum 20) for the agent. If the agent has not answered by then, the response is 202 with a job_id; poll GET /metrics/test/{job_id} every few seconds until it returns the result. The agent must answer within 2 minutes.
  • Without agent_id, only a public HTTP check can be tested, from Observer (mode: cloud); skipped_secret_headers names the header_refs that were not sent.
  • 409 agent_unavailable means no agent can run it now; reason says why (no_agent, offline, never_connected, outdated, revoked).
Nothing is stored: no metric, no sample, and no status change.

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.