DocumentaciónHelp

Monitor an API with steps and variables

Build a composite API monitor with authentication from the vault, several steps that pass variables to each other, JSON validations and custom metrics.

On this page

An API monitor runs one or more requests in order, as your system would: it signs in, captures a value from the response, uses it in the next request and validates each result. It can chart numeric values from the responses and alert with thresholds.

Before you start

  • You need permission to operate on Applications.

  • Tokens, keys and certificates are stored in the vault. An administrator creates them in Settings → Monitoring → Credentials.

Step 1: general details

  1. Go to Applications → WebServices and click Add WebService (or Edit on an existing one).

  2. Enter the Name and, if you want, choose the Group (optional).

The form has the Request, Authentication, Validations, Steps, Metrics and Where it runs tabs. When there is more than one step, in Request and Validations you choose at the top which step what you are editing belongs to.

Step 2: the request

In Request:

  1. Choose the Method and enter the URL.

  2. Add Parameters and Headers with Add parameter and Add header.

  3. For methods with a body, choose the Body Type: No body, JSON, Form or Text. If the JSON is not valid, the form warns you.

  4. In Options, adjust the Timeout (s) (1 to 60), Follow redirects and Verify the TLS certificate.

  5. Review the request Preview.

Do not put tokens or keys in the headers or parameters: use the Authentication tab. A method that changes data (POST, PUT, PATCH, DELETE) runs on every check; confirmation is requested when you save.

Step 3: authentication (login, token or OAuth2)

In Authentication:

  1. In Credential, choose one from the vault. It can be:

    • API token (in a header or a parameter, with a prefix).

    • Username and password (Basic).

    • OAuth2.

    • Token obtained from another API (a prior login).

  2. Optional: choose a Client certificate (mTLS).

  3. If there are several steps, select in Steps that use authentication which ones carry it.

Secrets are never shown and never stay in the results.

Step 4: steps and variables

In Steps:

  1. Click Add step (up to 10). Give each one a name.

  2. With each step's buttons you can edit its request, move it up, move it down, duplicate it or remove it.

  3. In Variables it captures, click Capture variable and define:

    • The variable name, for example token or pedido.

    • Where it comes from: JSON path (for example $.data.id), Header (for example Location) or Regular expression.

    • Secret, if it must not be shown or stored.

  4. Use the variable in the following steps by writing its name in double braces, for example {{pedido}}, in the URL, headers, parameters or body.

If a step uses a variable that no previous step captures, the form warns you.

Step 5: validations

In Validations, choose the type and click Add validation:

Type

What it compares

HTTP code

The expected codes, such as 200, 200-299 or 2xx.

Response time

Warning and critical in milliseconds.

Header

That a header exists, does not exist, equals or contains a value.

Body (text or expression)

That the body contains, does not contain, matches the expression or does not match the expression.

JSON value by path

That the value at a path (for example $.data.status) exists, does not exist, equals, is not equal to, is greater than, is less than or contains.

Each validation is Critical or Warning. A critical one marks the service as down and stops the following steps; a warning one puts it in warning. All of them must be met.

Step 6: metrics

In Metrics, chart numeric values captured in the steps:

  1. Click Add metric (up to 10).

  2. Choose the variable (not secret), enter the name (for example Pending orders) and the unit.

  3. Choose Alert if above or Alert if below and enter the warning and critical values.

The latency of each step is always charted.

Step 7: where it runs, test and save

  1. In Where it runs, choose Check from. See Choose where it is checked from.

  2. Click Test now. “Test now” result appears below with the status, the latency and the details of each step.

  3. Click Save. If something is missing, the form lists it before saving.

Related

Search Argunis Monitoring

Type at least 2 characters to search Argunis Monitoring.

↑↓ to navigate · Enter to open · Esc to close