Skip to content

13.5Retry safely

A request can fail on the network even when obsrvly received it. Then you cannot tell if it worked.

Some APIs accept an idempotency key (a header that makes a repeated request safe). obsrvly does not support an Idempotency-Key header. Use the rules below instead.

Kind of callSafe to repeat?What to do
Reads: Get…, List…YesRepeat as often as you like.
UpdateMonitorYesIt changes only the fields you send. The same update twice gives the same result.
SaveStatusPageYesIt replaces the whole page each time.
DeletesYesA second delete answers not_found, such as monitor not found. Treat that as done.
AcknowledgeIncidentYesThe first acknowledgement stands. No second notice is sent.
TriggerNowYesA repeat within 30 seconds is refused, so it cannot start two checks.
Creates: Create…NoA repeat makes a second copy. Check first, as shown below.

Retry a create#

  1. Call ListMonitors (or the matching list call, such as ListAlertChannels). ListMonitors shows the newest monitors first.
  2. Look for your item by its name or URL.
  3. If it is there, the first create worked. Do not create it again.
  4. If it is not there, send the create again.

Secret names are the exception. A team cannot have two secrets with the same name. A repeated CreateSecret answers already_exists (409), secret with this name already exists. That means the first create worked.

Create many URL monitors#

BulkCreateUrlMonitors takes up to 100 URLs per call. The answer has one result per URL. Each result has the url and either a monitor or an error. Send again only the URLs that have an error.

Which errors to retry#

ErrorWhat to do
unavailable (503) from a createSend it again.
resource_exhausted (429)Wait, then send it again (13.4).
internal (500), 502 upstream unreachable, or a network timeoutYou cannot tell if it worked. Check first with a list or get call, then retry.
invalid_argument, failed_precondition, permission_denied, not_found, already_existsDo not retry unchanged. Fix the request first.

Last updated