REST API Monitoring

REST API - An Overview

REST (REpresentational State Transfer) is a design concept (architecture) for managing state information which defines how data communication is to be done using HTTP protocols. The API calls which adhere to the REST definition (pretty much most of them!) are called REST APIs.

Monitoring REST API - What we do

  • Monitor the availability and response time of your REST API endpoints.
  • Get insight into the response time of mobile and web applications that use your API.
  • Verify that the APIs are returning the correct data in the response details tab.
  • Get notification when key API transactions fail.
  • Detect downtime and fix critical issues before customers are affected.

REST API monitoring - Adding a new REST API monitor

Prerequisites for monitoring REST API metrics: Click here

Using the REST API to add a new RESTAPI monitor: Click here

To configure REST API monitor, follow the steps mentioned below:

  1. Click on New Monitor link. Select REST API.
  2. Enter Display Name of the monitor.
  3. Enter REST API URL i.e the API call to be monitored.
  4. Enter Timeout in seconds, which is the amount of time spent by Applications Manager to establish a connection with the server hosting the API service.
  5. Select the Form Submission method used to access the API.
  6. If you select POST or PUT method, you will be asked to choose the PayLoad Type from the following options:
    • FORM: If you select this, enter the Pay Load in a line-by-line format
    • Text: If you select this, enter the Pay Load in text format
    • XML: If you select this, enter the Pay Load in XML format
    • JSON: If you select this, enter the Pay Load in JSON format
  7. Enter the credential details for user authentication by choosing any one of the following options:
    • Basic authentication: Authenticates the REST API endpoint using basic credentials such as username and password.
    • Credential Manager: Authenticates the REST API endpoint by selecting credentials from Credential Manager.
    • OAuth Token: Authenticates the REST API endpoint using an OAuth token, which is configured by selecting the OAuth provider from the dropdown.
    • Web Token: Authenticates the REST API endpoint using a Web Token, which is configured by selecting the Web Token from the dropdown.
  8. Configure the Custom HTTP(S) Headers required to establish a connection with the API server. Use _sep_ to separate the header name and value. For specifying multiple headers, use the separator #.
    Example: User-Agent_sep_Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36#Accept-Charset_sep_utf-8
  9. Specify the Response Type to be expected. For XML and JSON response, user can define XSLT / JSON Schema in the Response Details tab to fetch and monitor the custom attribute from the API Response.
  10. Enable the Add content check for response checkbox if you wish to perform content check in the API response. Once enabled, perform the following steps:
    • Specify the contents that should contain and/or should not contain while performing the check in the API response.
    • Enable the Do case sensitive keyword search checkbox if you wish to perform a content check for case-sensitive character strings.
    • Enable the Regular Expression checkbox if you wish to perform a content check based on regular expressions. (Refer Regex Guide for more info)
    • Make sure that the content you try to match is present in the API response.
    • The content search is case-sensitive. If you provide two or more words, the content match is performed for the words separately. Space character will be acting as the delimiter.
    • For example, if you specify the content as 'applications manager'", the match is found for 'applications' and 'manager' separately. If you need the content match to be performed for the complete text, specify the two words in quotes, like "applications manager".
  11. Specify the polling interval for which the status of the monitor should be updated (in minutes).
  12. Make sure the proxy settings configured in Applications Manager matches with the proxy settings in the browser. Bypassing the local addresses and subnet mask are required based on the API being monitored.
  13. Click Test Credentials button, to make sure the API service is accessible from the Applications Manager installed machine.
  14. Choose the Monitor Group from the combo box with which you want to associate REST API Monitor (optional). You can choose multiple groups to associate your monitor.
  15. Click Add Monitor(s). This discovers the REST API service from the network and starts monitoring.

Monitored Parameters

Go to the Monitors Category View by clicking the Monitors tab. Click on REST API under the Web Server/Services table. Displayed is the REST API bulk configuration view distributed into three tabs:

  • Availability tab gives the Availability history for the past 24 hours or 30 days.
  • Performance tab gives the Health Status and events for the past 24 hours or 30 days.
  • List view enables you to perform bulk admin configurations.

Following are the list of metrics shown in the REST API Sequence Monitor in their corresponding tabs:

Performance Overview

Parameter Description
Response Time Total time taken to get a REST API response, which is calculated as the sum of DNS lookup time, connection time and the time contracted to receive the response in JSON, text or XML.
Domain Name Resolution Time Amount of time taken to resolve a domain name into its IP address (in ms).
Connection Time Amount of time spent for establishing TCP connection with server (in ms).
Request Processing Time Amount of time taken to receive and process a request (in ms).
Download Time Amount of time taken for receiving last byte of the response for the API (in ms).
Page Size Total response size of the API (in bytes).
Page Size Change Change in response size of the API (in percentage).

Custom attributes in API response

Based on the response obtained, the user can define their own attributes for monitoring specific values in the API response under the Response Details tab.

  • If the response is of XML type: Using the XSLT transformation, the user can define specific values to be monitored. Ensure that the following criterias are met:
    • The output method should be of type 'text'.

      Syntax: <xsl:output method="text"/>

    • The final output should be of the format AttrName::AttrVal. Example: Days:<xsl:value-of select="days"/> would create an attribute 'Name' whose value will be the value of the <days> tag present in the API Response.
  • If the response is of JSON type: The JSON schema can be used to configure user-defined attributes. Ensure that the following criterias are met :
    • The attribute should be defined as AttrName::AttrValue. Example: will create an attribute name 'Temperature' containing the value of the temperature variable returned.
    • Multiple JSON Schemas can be defined by using new line as the delimiter.
    • If the JSON key itself contains a dot (.), then replace it with '_sep_'. This should be done for all the individual keys which contain a dot(.) in it. In the above example, say the last key 'temperature' was defined as 'temperature.celsius'. Then the format should be