How do I let an AI SRE look at JSON API endpoints when investigating failed deploys?
Tares polls any JSON endpoint with the http_poll connector and stores one event per item, so your AI SRE sees business data such as affected customers next to your telemetry. You give Tares the URL, pick an entity key, and Tares calls the API on a schedule with no script on your side. If the data lives in a Postgres table, the Postgres connector reads new rows incrementally on a cursor column instead.
How it works
The http_poll connector calls your endpoint on the source’s schedule, 10 seconds at the shortest, and turns the reply into events.
payload_keypoints at the part of the reply that is the payload, such asdata.items. Empty means the whole JSON. An object is one event, and a list is one event per entry.id_fieldis the deduplication key. An item whose value was seen in recent polls is not stored again. For a list API, use the entry’sid.event_time_fieldnames the field that holds the event’s time. Empty means the poll time.text_templateis the one-line summary of each event, built from payload values. Dotted names reach nested fields.labelsmark the entity key withprimary: true, for example the customer or tenant, so the events line up with the rest of your data.
The payload is stored as received, so labels you declare later can still reach every field.
Tares also handles the API’s limits. On a 429 or any 5xx it backs off, doubling the wait from the poll interval up to an hour, and it honors Retry-After. Any other 4xx shows up as a config error in the source’s health.
Set it up
- Pick the endpoint that shows who a failed deploy touched, such as a deploy status API, an orders export or a customer-impact endpoint of your own.
- Add the source. Ask a connected agent to set it up, or go to Sources → Add source → HTTP API (poll). Fill in the method, URL, any credentials, extra headers and, for POST, a body. Press Discover: Tares calls the API once, shows the reply and fills in what becomes an event. Pick the entity key from the fields it saw, then create the source.
- Check the shape. This is the form the source takes, shown here with the weather example from the connector page:
- name: weather_berlin
connector: http_poll
poll: 10m
config:
url: https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true
event_type: weather
event_time_field: current_weather.time
id_field: current_weather.time
text_template: 'Berlin wind {current_weather.windspeed} km/h, {current_weather.temperature} C'
labels:
- { name: city, const: berlin, primary: true }
- { name: windspeed, field: current_weather.windspeed, type: number }For your own API, swap in your url, set payload_key to the list in the reply, and make your entity field the primary label. You can also POST /api/sources with the same object.
4. Add the credential if the API wants one. One credential travels in one header. credential holds the whole value and is stored as a secret, never returned by the API and never exported. credential_header names the header, Authorization by default:
config:
url: https://api.example.com/v1/readings
credential: abc123 # an API key
credential_header: X-API-KeyOther headers the API needs on every request go in headers, which is not secret.
5. Verify. Open the source. Recent events shows each poll’s events with the summary line, and Fields lists every field seen, dotted names included, with its coverage. Use it to confirm your entity key is reliably present.
For the wider setup, see the HTTP API (poll) connector page and AI SRE.
What you get
- Business data in the same timeline as your logs, metrics and alerts, so a failed deploy can be read next to who was affected.
- One event per item, deduplicated by your
id_field, so the agent is not flooded with repeats. - A readable summary line per event from
text_template, and every field still reachable by label because the payload is stored as received. - Number labels you can trigger on. A number label such as
windspeedin the example can back a trigger likemax(windspeed) > 62 over 15m, which fires from the next reading that crosses it. - Backoff and clear health messages when the API rate limits you or rejects the request.
When something else fits
- If the data sits in a Postgres table, use the Postgres connector. It connects with a
dsn, tracks a cursor column such as anidorupdated_at, and creates one event per new or changed row, so it fits when you want to see changed rows without an API. - If a system should call Tares when something happens, use the webhook connector instead.
http_pollis for APIs that Tares calls.