peepshow/ sinks/ newrelic

Reel #34 Observability

peepshow sink / newrelic

New RelicPOST every run as a New Relic custom event.

`/v1/accounts/<id>/events` with camelCase attributes; one `PeepshowRun` event per run, queryable via NRQL.

drop · process · newrelic

What it does

Ship peepshow runs to the New Relic Events API as `PeepshowRun` custom events so they're queryable via NRQL alongside the rest of your telemetry. Attributes are flattened to camelCase alphanumerics (New Relic forbids dots), container tags land as `videoTag<Key>`, and both US + EU endpoints are supported.

When to reach for it

  • Chart peepshow frequency, latency, or failure rate via NRQL
  • Correlate video-processing runs with APM / browser / log data already in NR
  • EU-region accounts: set `NEW_RELIC_REGION=eu`

Install

npm i -g peepshow

Use it

NEW_RELIC_INSERT_KEY=... \
NEW_RELIC_ACCOUNT_ID=1234567 \
peepshow ./trigger.mp4 --sink newrelic

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

Configuration

  • NEW_RELIC_INSERT_KEY Events API Insert Key. Sent as the `Api-Key` header. required
  • NEW_RELIC_ACCOUNT_ID Numeric account id in the endpoint path. required
  • NEW_RELIC_REGION `us` | `eu`. Default `us`. Unknown values clamp to `us`.
  • NEW_RELIC_EVENT_TYPE Override for `eventType`. Default `PeepshowRun`.
  • NEW_RELIC_API_URL Full endpoint override (proxies / tests). Used verbatim.

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 New Relic 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 NEW_RELIC_INSERT_KEY="..."
export NEW_RELIC_ACCOUNT_ID="..."

2. Register as an auto-sink

peepshow sinks add newrelic
peepshow sinks add newrelic --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 New Relic 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'.