peepshow/ sinks/ pagerduty

Reel #33 Observability

peepshow sink / pagerduty

PagerDutyTrigger a PagerDuty Events API v2 incident on every run.

`trigger` payload with peepshow metadata and optional frame images.

What it does

Fire a PagerDuty Events API v2 `trigger` so peepshow runs show up on an incident timeline. `dedup_key` collapses retriggers onto one incident; `PAGERDUTY_IMAGE_BASE` attaches up to `PAGERDUTY_MAX_IMAGES` frames as incident images when the frames are served publicly.

When to reach for it

  • Auto-trigger a page when a critical video-processing job completes
  • Cluster retriggers of the same clip with a stable `PAGERDUTY_DEDUP_KEY`
  • EU-region PagerDuty: override `PAGERDUTY_EVENTS_URL`

Install

npm i -g peepshow

Use it

PAGERDUTY_ROUTING_KEY=... \
PAGERDUTY_SEVERITY=warning \
peepshow ./trigger.mp4 --sink pagerduty

Make it automatic

Register the sink once — every run fires it afterward. Scope by --when so it only runs for matching videos.

peepshow sinks add pagerduty
peepshow sinks add pagerduty --when extension=mp4,mov
peepshow sinks add pagerduty --when path=/Volumes/Work/

Configuration

  • PAGERDUTY_ROUTING_KEY Integration key from the service's Events API v2 integration. required
  • PAGERDUTY_SEVERITY `info` | `warning` | `error` | `critical`. Default `info`.
  • PAGERDUTY_DEDUP_KEY Stable key so retriggers collapse onto one incident.
  • PAGERDUTY_SOURCE `payload.source` label. Default `peepshow`.
  • PAGERDUTY_IMAGE_BASE URL prefix — attaches frames as images when set.
  • PAGERDUTY_MAX_IMAGES Cap on attached images. Default `4`.
  • PAGERDUTY_EVENTS_URL Override for the EU DC or tests.

Use with an LLM agent

Every peepshow sink reads its config from env vars and receives a single JSON payload on stdin. An LLM agent (Claude Code, Cursor, Windsurf, Gemini, Codex) can drive the PagerDuty sink automatically when three things are true:

  • the env vars below are exported in the agent's shell (or a project .env it can load),
  • the peepshow CLI is on PATH — install with npm i -g peepshow,
  • a peepshow auto-sink is registered for the run (optional but recommended — makes invocation zero-argument).

1. Set the environment

# Add to ~/.zshrc, ~/.bashrc, or a project .env the agent can load
export PAGERDUTY_ROUTING_KEY="..."

2. Register as an auto-sink

peepshow sinks add pagerduty
peepshow sinks add pagerduty --when extension=mp4,mov

3. Example LLM session

You → drop a .mov into Claude Code.

Claude → auto-invokes /peepshow:slides ./clip.mov. peepshow extracts frames + audio, the PagerDuty sink forwards the run to the alert / incident stream. Claude replies with a summary and a link to the created record.

Transcript metadata (language, duration, silence ratio) tags each event.

Write your own

A sink is any executable that reads the --emit json payload on stdin. Shell, Node, Python, Go — the spec's in docs/PLUGINS.md. Register persistent ones with peepshow sinks add-cmd 'your-command'.