API Monitoring
Transaction tests mimic user journeys through web applications. But the user journey may include not only in-app user clicks, but also machine-to-machine interactions, in form of API calls.
When you need to monitor API calls at a granular level, whether to a third-party API or your own microservices, you can use the ThousandEyes synthetic testing framework to emulate conditional backend interactions with API endpoints.

Comparing Browser Synthetics and API Monitoring

The umbrella of ThousandEyes web transactions covers two main areas:
    Browser synthetics
    API monitoring
With browser synthetics, you write a script to simulate a user’s journey within a browser. When that script is run, you get detailed measurements of each step in the workflow.
With API monitoring, you monitor without the use of a browser. Your script simulates machine-to-machine interactions, and measures the availability and performance of API endpoints.

Use Cases for API Monitoring

Consider the following common situations when you would use API monitoring:
    Authentication
    Your app has to authenticate the user before they can proceed in the workflow.
    Output-to-input
    You need to take the response from one API endpoint, and use it in the request body for another API endpoint. For example, first you fetch a list of records; then you request details for a particular record from that list.
    API gateways
    You want to measure the performance of your API gateway, particularly if your APIs are served in a hybrid cloud environment.
    Validate API response
    When an HTTP response code is not sufficient, you may need to inspect the API endpoint's response body.
    Dynamic request parameters
    You generate request parameters at runtime. For example, to exercise an API endpoint that supports a timestamp parameter, your ThousandEyes test can generate a timestamp value to use in the request.

Creating API-Monitoring Tests

Consider the following actions that your transaction test script might include:
    HTTP requests
    Transaction test scripts can make requests against one or more HTTP API endpoints, and can chain data from one call to the next, if needed.
    To include this kind of monitoring in your script, you'll use the node-fetch module. For detailed instructions, see Using the node-fetch Module.
    TCP connections
    Transaction scripts can establish TCP connections to network targets, and can send arbitrary data (without application-layer awareness).
    To include this kind of monitoring in your script, you'll use the net module. For detailed instructions, see Using the net Module.
    TCP connections with TLS
    Transaction scripts can establish TCP connections to network targets that are secured with TLS.
    To include this kind of monitoring in your script, you'll use the tls module. For detailed instructions, see Using the tls Module.
Last modified 1mo ago