PostHogResend

Email a digest of new PostHog errors

A PostHog + Resend agent flow

PostHog's error tracking groups exceptions by issue, but nobody on a small team keeps that tab open. A short email when a new error group appears, or an old one spikes, puts it in front of the person who owns the code. The agent lists the project's errors with list-errors, compares the set against the last run, and emails the new or newly-busy ones with Resend's send-email, a digest naming each error, its count, and a link into PostHog. PostHog answers the call rather than pushing, so the agent reads on a schedule and the email follows by your interval, sent to one owner or a small list.

The flow

PostHoglist-errors

List errors in the project.

Resendsend-email

Sends a single transactional email immediately or scheduled, with HTML/text, attachments, CC/BCC, and tags.

Step by step

  1. Decide the threshold and the recipient

    Choose what earns an email, a brand-new error group or one whose count jumped over a bound, and the address it goes to. Verify your sending domain in Resend before the first send.

  2. List the errors

    The agent calls list-errors for the project and reads each error group's identity and occurrence count at read time.

  3. Diff and email the new ones

    Compare against the counts stored last run. If a group is new or has crossed your bound, the agent calls send-email with a digest of those groups and a tag so Resend can filter these alerts.

  4. Email on the edge, not every run

    Persist the error groups and counts you've already emailed. Send when a group first appears or crosses, so a busy-but-known error doesn't generate an email every poll.

Tell your agent

Every 15 minutes, list errors in the PostHog project. Compare against the last run, and if any error group is new or its count has more than doubled, send a Resend email from alerts@acme.com to eng@acme.com with a digest of those groups, their counts, and PostHog links, tagged 'posthog-errors'. Don't re-email groups that haven't changed.

Setup

This flow needs both servers connected to your agent. Follow each install guide:

Worth knowing

  • list-errors gives you the error groups; for the stack trace or a specific occurrence the agent calls error-details on a group, so include only the summary in the digest unless you ask for more.
  • send-email needs a verified Resend domain with SPF and DKIM. Send from an address on that domain, or the digest silently fails to deliver.
  • Error counts climb continuously. Store the last counts and alert on the delta, or every poll looks like 'new activity' and the inbox fills.

Questions

Why email instead of posting to chat?
Email suits a daily or per-shift digest one owner reads, and leaves a searchable trail. For real-time team visibility, the same read pairs with a chat post tool instead of send-email.
Does the email arrive the instant an error first occurs?
No. PostHog responds when the agent queries it, so the email trails the first occurrence by your interval. A 15-minute loop balances freshness against query volume.