0

I setup a monitor for a postman API(around 200 requests and each request has a timeout set for 1.5sec) collection however I see it time-out with this error : Error: callback timed out

I notice the timestamp when monitor started as well as failed with this issue and it seems to timeout exactly at 5 min. Hence its not running all the apis in the collection. Is there an alternative to tackle this situation? I believe that 5min is a limitation on postman monitor platform but wondering if there is a way to setup monitors for may be just a sub-collection folder in this main collection that I have my monitor set.

anonymous-explorer
  • 365
  • 1
  • 12
  • 26

1 Answers1

2

As indicated here, each monitor run is limited to a time limit of 5 minutes. Beyond that, your monitor will just stop running the collection and as you've already mentioned, some of your API endpoints will not be hit.

However, it still is possible to cover all your API endpoints, albeit while using more than a single monitor:

Postman API

You can use the Postman API to trigger monitors using HTTP requests.

Step-1: Break up your collection

Say that your Postman collection has 200 requests. Let's say that the monitor does not execute more than 70 requests (on average).

  1. Divide your collection (C) up into 4 different collections, which contain 50 requests each, while making sure that these 50 requests run under 5 minutes. Let's call these collections C1, C2, C3, C4 and the order in which the requests were arranged in C requires that the new collections run in the order C1 -> C2 -> C3 -> C4.

Note: Monitor runs are priced and how you break up your collection can determine your monitoring costs.

  1. Create a monitor for each of C1, C2, C3 and C4 (M1, M2, M3, M4) and set it up to run with the same environment that you were using for C.

Step-2: Add monitor triggers at the end of each collection

  1. As mentioned earlier, you can use the Postman API to trigger a monitor using a HTTP request.
  2. So, as the last request of C1, create a request that contains the endpoint that triggers a monitor and set it up to trigger M2. (You can learn how to do that here: https://docs.api.getpostman.com/?version=latest#5b277ca0-7114-e04e-f1f5-246fbbd6d973 )
  3. As the last request of C2, create a request that triggers C3, and so on.

Monitor runs

  1. When you manually or by setup, trigger the M1, the requests in C1 run and the runner reaches the last request for C1.
  2. Here, you communicate with the Postman API that you want M2 to run now.
  3. M2 begins running now, and the runner now reaches the last request of M2, which triggers M3.
  4. Eventually, M4 finishes running and all your API endpoints have been hit.
cazaimi
  • 196
  • 11