How do I line up PagerDuty incidents with Prometheus metrics on one timeline?
Tares puts PagerDuty incidents and Prometheus metrics on one timeline by giving both sources the same service label. The incident shows what fired, and the metric events next to it show how the service got there. PagerDuty reaches Tares through the webhook connector and a vendor setup, and Prometheus is polled by its own connector.
How it works
Tares builds one timeline per service from every source that carries the same key label. You set up two sources and label both with service.
- Prometheus metrics. The Prometheus connector polls the metrics you pick by name or by label. You write no PromQL. Each series becomes a metric event on every poll tick, and the numeric value is stored as a number-typed
valuelabel. - PagerDuty incidents. Tares has no connector of its own for PagerDuty today. A PagerDuty v3 webhook subscription posts to the ingest URL of a webhook source, and the payload is stored lossless. Labels map payload fields into the envelope.
- The join. Both sources carry
service, so incident events and metric events appear together on that service’s timeline, merged on one clock. This is the same per-service timeline the AI SRE guide builds its agents on.
The PagerDuty payload nests everything under event, with fields such as event.event_type, event.id, event.resource_type and event.occurred_at. Labels read one-level dotted fields such as these. The webhook event_type_field reads top-level fields only, so you set a fixed event_type instead.
Set it up
-
Install and start Tares. Install with
uv tool install tares,pipx install taresorbrew install glassflow/tap/tares, then start it:tares up -
Add the Prometheus source. In Sources, Add source, Prometheus, enter the Prometheus URL, run Discover and tick the metrics you want. Tares generates the config. Make
servicethe primary label and keep the numericvaluelabel:- name: metrics connector: prometheus poll: 10s config: url: http://localhost:9090 queries: - promql: '{__name__=~"(pg_stat_database_xact_commit|pg_up)"}' # generated from your picks by_name: true labels: - { name: service, field: metric.service, primary: true } - { name: value, field: value, type: number } # the metric value, aggregate it in triggers -
Add the PagerDuty webhook source. In Sources, Add source, webhook, declare labels and save. Then copy the ingest endpoint from the source page. If you scope the PagerDuty subscription to one service, give the source a constant
servicelabel with that service’s name, the same value your metrics carry:- name: pagerduty-incidents connector: webhook config: event_type: pagerduty_incident labels: - { name: service, const: api-server, primary: true } - { name: incident_event, field: event.event_type } - { name: resource, field: event.resource_type } -
Create the PagerDuty subscription. In PagerDuty, create a v3 webhook subscription, in the console or with the Webhook Subscriptions API. Set its delivery URL to the Tares ingest URL. Choose events such as
incident.triggeredandincident.resolved, and a scope: account, team or service. -
Add the credential if Tares has auth on. Add a custom header
Authorization: Bearerfollowed by an ingest-scoped API key to the delivery method. Do not set a signature scheme on the source. PagerDuty signs with av1=prefixed header thathmac_sha256does not accept, so the Bearer header is the credential. -
Verify. Trigger a test incident. Check Recent events on each source, and check Fields on the webhook source to confirm the labels arrive. Then open Explore, pick the service, and read incidents and metrics together.
What you get
- One timeline per service with PagerDuty incident events and Prometheus metric events side by side.
- Triggered and resolved incidents next to the metric movement around them, so you see the climb before the page.
- A numeric
valueon every metric event, so a trigger over the service can aggregate it withmax,avgorsum. - The full PagerDuty payload stored lossless, with the labels you declared available for correlation.
- The same single read for a connected agent or MCP client, so an investigation starts from the correlated evidence instead of from two separate tools.
When something else fits
- If you only need the incident list, PagerDuty’s own console already shows it. Tares adds value when you want it merged with metrics and other sources per service.
- If you need a computed metric such as a p99, use an advanced
queriesrow in the Prometheus connector with an explicitevent_typeandfield. - If PagerDuty incidents span many services, use one webhook source per service scope, or point the subscription at the scope you need.