peepshow/ sinks/ opsgenie

Reel #36 Observability

peepshow sink / opsgenie

OpsgenieCreate an Opsgenie alert per peepshow run.

`POST /v2/alerts` with run metadata, priority, tags, and the full frame list.

drop · process · opsgenie

What it does

Fire an Opsgenie Alert API v2 request so peepshow runs show up on an on-call timeline. Supports both US (`api.opsgenie.com`) and EU (`api.eu.opsgenie.com`) regions, priorities `P1`..`P5`, and passes every `video.tags[key]` through as alert `details` plus a markdown description listing every extracted frame.

When to reach for it

  • Page on-call when a critical video-processing job finishes
  • EU-region Opsgenie tenants: set `OPSGENIE_REGION=eu`
  • Escalate severity per clip: flip `OPSGENIE_PRIORITY` to P1/P2

Install

npm i -g peepshow

Use it

OPSGENIE_API_KEY=... \
OPSGENIE_PRIORITY=P2 \
peepshow ./trigger.mp4 --sink opsgenie

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 opsgenie
peepshow sinks add opsgenie --when extension=mp4,mov
peepshow sinks add opsgenie --when path=/Volumes/Work/

Configuration

  • OPSGENIE_API_KEY API token from a Team API integration. Sent as `Authorization: GenieKey <token>`. required
  • OPSGENIE_REGION `us` | `eu`. Default `us`. Unknown values clamp to `us`.
  • OPSGENIE_PRIORITY `P1` | `P2` | `P3` | `P4` | `P5`. Default `P3`.
  • OPSGENIE_MESSAGE Override for the alert `message` title. Clamped to 130 chars.

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 Opsgenie 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 OPSGENIE_API_KEY="..."

2. Register as an auto-sink

peepshow sinks add opsgenie
peepshow sinks add opsgenie --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 Opsgenie 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'.