How do I test PagerDuty incidents about 5xx errors on an API before a real incident?
Tares lets you test PagerDuty incidents about 5xx errors on your API by posting a sample payload to a webhook source’s ingest URL and checking Recent events and Fields. PagerDuty reaches Tares through the webhook connector and a vendor setup, and Tares has no connector of its own for PagerDuty today. You see how your labels map before PagerDuty sends anything real. The check takes one curl command.
How it works
- A PagerDuty v3 webhook subscription POSTs JSON to the Tares ingest URL of a webhook source. The payload is stored lossless, so the full incident stays on the event.
- Labels map payload fields into the event. PagerDuty nests its fields under
event, so use one-level dotted fields such asevent.event_type. - The source uses a fixed
event_type, becauseevent_type_fieldreads top-level fields only. - The 5xx detail sits deeper in the payload, so it stays in the stored payload and is not a label. A
servicelabel with a constant value names your API and is the primary label. - Do not set
signature_schemeon this source. PagerDuty signs with av1=prefixed header thathmac_sha256does not accept. test_sourceon a push source takes no payload and only returns the ingest endpoint, so it does not check the label mapping. To check the mapping, post a sample payload yourself and read Recent events and Fields on the source page.
Set it up
- Start Tares locally if it is not running yet.
tares up- Create a webhook source under Sources → Add source → webhook, or ask a connected agent to create it. Declare these labels. The
servicelabel is a constant that names your API and is the primary one. Theincident_eventlabel reads the PagerDuty event name and is not primary.
- name: pagerduty-api
connector: webhook
config:
event_type: pagerduty_incident
labels:
- { name: service, const: api, primary: true }
- { name: incident_event, field: event.event_type }
- { name: resource_type, field: event.resource_type }- Copy the ingest endpoint from the source page and post a sample triggered incident. The payload follows the PagerDuty v3 shape, and the
datatext is your own sample about 5xx errors.
curl -X POST http://localhost:8787/ingest/<ingest_key> \
-H 'Content-Type: application/json' \
-d '{"event":{"id":"TEST1","event_type":"incident.triggered","resource_type":"incident","occurred_at":"2026-10-20T10:00:00Z","data":{"title":"5xx errors on the API"}}}'- On a secured instance (
tares up --auth), send an ingest-scoped API key as an Authorization Bearer header with the same request. Without auth on, no header is needed. - Open the source page. In Recent events, confirm the event arrived with
serviceset toapiandincident_eventset toincident.triggered. Open Fields to see which payload fields arrive and how often. - Post the same payload again with
incident.resolvedas theevent_type. Recent events now shows a second event whoseincident_eventlabel has the new value. - When the mapping looks right, wire up PagerDuty:
- Create a v3 webhook subscription, in the console or with the Webhook Subscriptions API, whose delivery URL is the Tares ingest URL.
- When Tares has auth on, add a custom header
Authorization: Bearerfollowed by your ingest-scoped API key to the delivery method. - Choose the events, such as
incident.triggeredandincident.resolved, and the scope: account, team or service.
What you get
- Proof that your ingest URL accepts the PagerDuty payload shape and, on a secured instance, your ingest key.
- A checked label mapping: you see
service,incident_eventandresource_typeon real stored events, and Fields shows which payload fields arrive. - Triggered and resolved samples that you can tell apart by their
incident_eventvalue. - A source that is ready for the live subscription, so the first real 5xx incident lands in a source you have already exercised.
For how Tares uses events from your sources once they arrive, see AI SRE.
When something else fits
- If your 5xx alerts reach you through Alertmanager rather than PagerDuty, the alertmanager connector turns each alert in a batch into its own event and has its own test curl.
- If you only need to confirm that PagerDuty can reach Tares at all, one sample post to the ingest URL is enough. Skip the extra labels until you know which fields you want to correlate on.
Related
Last updated on