Skip to content
Uptizm

Track custom metrics

Pull a number or a status out of your endpoint's response, chart it on every check and alert when it crosses a bound.

Updated

A custom metric is a value Uptizm reads out of the response of each check, such as memory use from a JSON route or a status word in a header. It records the value on every check, charts it and can open an incident when it goes out of bounds.

Before you start

A metric is read from the response of a monitor's checks, so the value has to be in what your endpoint returns: the JSON or HTML body, a header, or the status code. Run at least one check first, because the form tests your rule against a real response.

Response time and the other system metrics are collected by default. You only add the ones your endpoint exposes.

Add a metric

  1. Open Monitors, select the monitor and open the Metrics tab.
  2. Under Custom metrics, select Add metric. To get ideas first, select Suggest metrics: Uptizm reads the last captured response and proposes metrics. Tap one to open it as a filled-in form. Nothing is added until you save it. Suggestions are available from the Starter plan.

The Metrics tab with the System metrics section and an empty Custom metrics section

  1. In Name, type a label, for example "Memory usage".
  2. In Key, type a lowercase snake_case id, for example memory_usage. It is used in charts and alert rules.
  3. Choose the Type: Numeric, Status or String.
  4. Choose the Source, where the value comes from:
    • JSON path: a path into a JSON body.
    • Regex: a pattern with one capture group.
    • XPath (HTML/XML): a path into an HTML or XML body, for example a DOM node's text.
    • Header: a response header name.
    • HTTP status: the status code, with no path needed.
  5. In Extraction, enter the path, pattern or header name.
  6. For a numeric metric, choose the Unit, for example Milliseconds (ms), Percent (%), Count or Bytes.

Test the rule

  1. In Test extraction, select Fetch & test.
  2. Uptizm fetches a sample and shows Resolved with the value it found, along with which check it used.
  3. If it says Couldn't resolve, adjust the path and select Test again.

Candidate values lists values Uptizm found in the last response. Select Use next to one to fill the form with it.

The Test extraction row of the metric form with its Resolved result

Set the bounds

For a numeric metric:

  1. Choose Threshold direction: Higher is worse or Lower is worse.
  2. Enter Warn and Critical values.

When the value crosses a bound, Uptizm opens an incident named after the metric, such as "Memory usage breached critical bound".

For a status or string metric, use String matching. List values under OK values, Warn values and Critical values. Matching ignores case and surrounding whitespace. A value that is in none of the lists records no band and raises no alert, unless you set Unmatched values.

Watch for anomalies

Switch on Watch this metric under Anomaly detection to flag unusual readings and a metric that stops reporting, with no fixed bound. Choose which direction is bad (Up is bad, Down is bad or Both), the Reading type (Gauge, Counter or Count per period) and the Sensitivity. It runs only while the monitor's own anomaly detection is on, and anomaly detection starts on Starter.

The Anomaly detection section of the metric form with a direction and sensitivity chosen

Select Create metric to save.

What happens next

From the next check, the metric is recorded and charted. Select it to see Recent readings and a history chart. A band is recorded when each check runs, so changing a bound later does not re-grade past readings. A metric that has not reported lately shows No recent data.

To edit or delete a metric, open it from the list. Deleting removes its recorded history for good.

You can also publish metrics on a status page. See Create a status page.

Still stuck?

The FAQ covers the most common questions. For anything else, write to us.

Try it on your own site

Start free and point Uptizm at your first URL.

Start free