Metrist API

Introduction

Metrist has a REST-like API that allows you to obtain things like service monitor statuses automatically.

API keys

Authorization to the API is through API keys, which - for now - you can obtain by requesting them from us. The key is an opaque string that you pass in through as a bearer token in an authorization header:

Authorization: Bearer API_TOKEN_GOES_HERE

Versioning

The API request path contains a version number that we use for major, breaking updates. Currently we have API calls in the following versions:

API calls

Get monitor statuses

Return the status of one or more monitors.

Parameters:

Returns an array of JSON objects containing logical name, display name and status for each monitor that could be found (invalid logical names simply will not return a corresponding object).

Example:

curl -H "Authorization: Bearer XXX" 'https://app.metrist.io/api/v0/monitor-status?m[]=testsignal'

Returns:

[
  {
    "monitor_logical_name": "testsignal",
    "last_checked": "2022-04-21T14:58:17.175203",
    "state": "up"
  }
]

Values for monitor parameter

The following values are available for the m[] parameter(s):

Metrist

AWS

Azure

Google Cloud Platform

APIs

Infrastructure

SaaS

Add monitor configuration

Adds a monitor configuration.

Sample request body:

{
  "monitor_logical_name": "asana",
  "interval_secs": 120,
  "run_groups": ["Metrist Agent"],
  "run_spec": {
    "name": "asana",
    "run_type": "dll"
  },
  "steps": [
    {
      "check_logical_name": "Ping",
      "timeout_secs": 900
    }
  ]
}

Returns the ID of the MonitorConfig object.

Example:

curl -d $JSON -H "Content-Type: application/json" -H "Authorization: Bearer XXX" 'https://app.metrist.io/api/v0/monitor-config'

Returns:

11y9YlrWxXf39mRWIrhFtPl

Delete monitor configuration

Deletes a monitor configuration.

Example:

curl -X DELETE -H "Authorization: Bearer XXX" 'https://app.metrist.io/api/v0/monitor-config/asana/11y9YlrWxXf39mRWIrhFtPl'

Returns:

OK