How do I put JSON API endpoints beside Vercel deploys?
Tares puts a polled JSON API and Vercel deploys on one timeline when both sources carry the same label value and you mark that label as the key. Add a vercel source for the log drain and an http_poll source for the endpoint, and give both a primary label with the same name and value, such as the Vercel project name. Tares then merges their events on one clock for that entity, ready for you or an agent to read.
How it works
Tares builds one timeline per entity. The entity is the value of each source’s primary label, so two sources share a timeline only when that value matches exactly.
- The Vercel logs connector receives a Vercel log drain, one event per log entry. It keys events by
project, taken from the payload’sprojectName, elseprojectId. It also providesenvironment,source,path,host,deploymentandbranchlabels. - The HTTP API (poll) connector calls a JSON endpoint on a schedule and stores one event per item. Nested values are reachable by dotted name, so labels and triggers can use them.
- The http_poll source has no project field of its own, so you give it a constant label whose value is your Vercel project name. Both sources then resolve to the same entity.
The pattern is the one the AI SRE guide uses. Metrics, logs and alerts are all keyed by the same service label, so they appear merged on one timeline per service.
Set it up
-
Pick the shared label. For Vercel deploys the natural choice is the project name, for example
web. Use the same label name and the same value on both sources. -
Start Tares. The Vercel drain delivers from Vercel’s cloud, so the ingest endpoint must be publicly reachable, through a deployed instance or a tunnel. A bare localhost daemon will not receive drains.
tares up -
Add the Vercel source under Sources → Add source → vercel, or
POST /api/sourceswith this object. Theprojectlabel is already the key. Copy the ingest endpoint from the source page.- name: web-logs connector: vercel config: labels: - { name: project, field: project, primary: true } - { name: environment, field: environment } - { name: source, field: source } -
In Vercel, open Team Settings → Log Drains → Add Log Drain. Set the endpoint to the ingest URL and the delivery format to JSON. Tares echoes back the
x-vercel-verifyheader from Vercel’s verification request. If Tares has auth on, add the drain’s custom header as an Authorization Bearer header holding an ingest-scoped API key. Without auth, no header is needed. -
Add the JSON API source under Sources → Add source → HTTP API (poll), and press Discover to let Tares read one reply. Give it a constant primary label named
projectwith the Vercel project’s name as its value. If the API needs a credential, setcredentialandcredential_header. Tares stores the credential as a secret.- name: web-api-status connector: http_poll poll: 5m config: url: https://api.example.com/v1/readings event_type: status credential: abc123 credential_header: X-API-Key labels: - { name: project, const: web, primary: true } -
Open each source and check Fields. It shows which
projectvalues appear and each field’s coverage. Then open Explore and pick the project. Deploy log events and API readings sit on the same clock.
What you get
- One timeline per project that shows an API reading beside the deploy and log events around it.
- Fields from the API reply that you can use in labels, trigger filters and trigger conditions, because nested values are reachable by dotted name. For a number label, a trigger can use a condition such as
max(windspeed) > 62 over 15m. - Deduplicated polling. Set
id_fieldand an item seen in recent polls is not stored again. - Built-in rate-limit handling. Tares refuses a poll under 10 seconds and backs off on a 429 or any 5xx, up to an hour, and the source’s health says when the next try happens.
- A base for the incident flow in the AI SRE guide: a trigger can watch both sources keyed by the same label and wake an agent with the correlated timeline.
When something else fits
- If the data you want beside deploys lives in your own database, use the Postgres table connector. It reads new and changed rows on a cursor column, and a constant primary label gives it the same key.
- If a system can call Tares itself, such as a CD pipeline that reports each deploy, a push source fits better than polling. If
projectreads sparse on the Vercel source, pick a denser field as the key, or slice bysourceorenvironment.