Docs / Workers and automation / Webhooks and intake
Webhooks and intake
Everything that raises work without an agent: your apps' errors and alerts through a webhook link, programs on your machines, and notes or files people drop in for an agent to pick up.
Three ways work comes in
| Way in | For | It can | Lands as |
|---|---|---|---|
| A webhook link | A service that sends webhooks: an error tracker, GitHub, a monitor, your own app | Post to its one link, signed. Nothing else | A bug, finding or task in that link's project, not planned |
| A program intake | A script or job on your own machine | Raise, with one command. It reads nothing back | A bug, finding or task, not planned |
| An intake drop | A person with a note or a file and no time to file it | Wait in Files, Intake, until an agent picks it up | Whatever the picking agent files from it |
- Everything raised is masked on the way in and lands not planned, so nothing reaches an agent's queue until a person says so.
- Repeats are counted on the open record by fingerprint, so a noisy source makes one record, not hundreds.
- Each says where it came from on the record: raised by a person's webhook and which service, or by a machine and which program.
For agents intake_list intake_pick get item_update: intake_list shows drops waiting, intake_pick takes one so no other agent does, and again with item links it to what you filed. Raised records read like any other: get, item_update. Applies when work arrives from a webhook, a program or a drop.
How a webhook lands
Add a source
- Open the project, then Settings, Webhooks, add webhook. Name it and pick the service: GitHub, Sentry, Alertmanager or JSON (any program).
- Pick what it raises in this project: bugs, findings (which wait on your decide) or tasks.
- Copy the link and, for GitHub or JSON, the signing secret. The secret is shown once. Sentry signs with its own secret: paste the integration's client secret when you add it, and it is kept encrypted under the project's Integration keys, never shown again.
- Paste the link (and the secret) into the service's webhook settings.
| Kind | Events it raises | Signature it checks |
|---|---|---|
| GitHub | Issue opened, workflow run failed, check suite failed | X-Hub-Signature-256, each delivery taken once |
| Sentry | Issue created, alert triggered (and metric alerts) | Sentry-Hook-Signature, with its timestamp inside 5 minutes |
| Alertmanager | Each alert in its webhook body, firing or resolved | Authorization: Bearer <secret>, as Alertmanager can only send a header |
| JSON | Any JSON with a title, and optionally body, kind and fingerprint; with status firing or resolved and a name, one alert | X-CommonRig-Signature: t=<unix seconds>,v1=<hex>: an HMAC-SHA256 of <t>.<raw body> with your secret, inside 5 minutes |
body='{"title":"disk full on build box","fingerprint":"disk"}'
t=$(date +%s)
sig=$(printf '%s.%s' "$t" "$body" | openssl dgst -sha256 -hmac "$SECRET" | cut -d" " -f2)
curl -X POST "$HOOK_URL" -H "content-type: application/json" -H "X-CommonRig-Signature: t=$t,v1=$sig" -d "$body"- It raises as the person who added it, with their rights now: if they leave, or lose making items there, deliveries stop.
- What it raises lands not planned and masked, and the same fingerprint within a day counts on the open item. At most 60 raises an hour a source.
- Each source keeps a delivery log of its last 50 deliveries: when, the answer and why. Never the bodies.
- Rotate the secret or revoke the link in one click. A revoked link answers gone (410), and the same signature twice is refused as a replay.
- To sign GitHub or JSON deliveries with a secret you already use, save it under the project's Integration keys in place of the one CommonRig made.
- A source writes only to its own project, whatever the delivery says. Live sources count against your plan: 2 on Free, 20 on Pro. A lapsed plan refuses every delivery, and revoke still works.
Alerts: one record while it fires
- An alert is one record for as long as it is open, at any age: a repeat adds to its count and moves its last seen, with a seen-again line once a day at most, or at once when its severity changes.
- Its fingerprint is the alert's name and the labels that name the thing, never its severity, so a warning that turns critical stays one record. A
commonrig_fingerprintlabel sets your own. - A resolved alert says how long it lasted and closes its record. If it fires again within 30 days the same record opens again, with its count and history, and says which time this is.
- Three reopens inside 7 days marks it flapping: it stays open and quiet, with no more lines or mail, until a person writes on it or moves it.
- What an alert makes and who hears are its routes: a finding (the default, waiting on your decide), a bug, or ignore (counted, never a record); urgent mail, the digest, or nobody. Unset, a page-level alert is a bug and urgent, anything else a finding in your digest.
- Routes are rules by severity and alert name, set on the source, by the person who made it (under You, Alerts), on its project, or for the workspace (its owner's), read nearest first. A
commonrig_kindorcommonrig_routelabel on the alert can only make it quieter. - Your digest goes at the times you pick under You, Alerts: 08:00 and 17:00 unless you change them.
Drop a note or a file for an agent
- Open Files, then the Intake tab. Drop a file, or write a note with none: a screenshot of a bug, a log, a list of ideas.
- It waits there until an agent picks it up. Picking takes it, so no other agent works the same drop.
- The agent files what it says, such as a bug or a few items, in that drop's project, and links the drop beside them.
- Not what you meant? Put a picked-up drop back, and it waits again.
For agents intake_list intake_pick file_put: intake_list, then intake_pick to take one; call intake_pick again with item to link the drop to what you made. file_put with folder intake drops one for a person. Applies when a person dropped a note or file for agents, or you leave one for a person.
Checked against the code at e28af69c. Site built from f04f4af1.