Skip to main content

Alert

Create and manage metric alerts for monitoring
2 min read

The Alert resource allows you to create and manage alerts that notify you when metrics exceed or fall below specified thresholds in PostHog.

Example Usage#

Basic Alert#

Low Signup Alert#

Percentage Change Alert#

Daily Check Alert#

Weekend-Skipping Alert#

Series-Specific Alert#

Resource Properties#

Required Arguments#

  • insight (number): Numeric ID of the insight this alert monitors
  • thresholdType (string): Type of threshold - "absolute" for fixed values or "percentage" for relative changes
  • subscribedUsers (number[]): List of user IDs to notify when the alert fires

Optional Arguments#

  • name (string): Alert name
  • enabled (boolean): Whether alert is enabled (default: true)
  • thresholdLower (number): Lower bound of the threshold - alert fires when value goes below this
  • thresholdUpper (number): Upper bound of the threshold - alert fires when value goes above this
  • calculationInterval (string): How often to check - "hourly", "daily", "weekly", or "monthly"
  • conditionType (string): Condition type - "absoluteValue", "relativeIncrease", or "relativeDecrease"
  • seriesIndex (number): Index of the trend series to monitor (0-based)
  • checkOngoingInterval (boolean): Whether to check the ongoing (incomplete) interval
  • skipWeekend (boolean): Whether to skip checking the alert on weekends

Attributes#

  • All configured properties

Threshold Types#

Absolute Value#

Fixed numeric thresholds:

Percentage Change#

Relative change thresholds:

Calculation Intervals#

Hourly#

Check metrics every hour:

Daily#

Check once per day:

Weekly#

Check once per week:

Monthly#

Check once per month:

Best Practices#

1. Use Descriptive Names#

2. Set Appropriate Thresholds#

3. Notify the Right People#

Common Use Cases#

Error Rate Monitoring#

Conversion Drop Detection#

Traffic Spike Alert#

Troubleshooting#

Alert Not Firing#

Issue: Alert doesn't trigger when threshold is exceeded

Solution:

  • Verify the alert is enabled
  • Check calculation interval matches expectation
  • Confirm insight ID is correct
  • Ensure threshold values are set appropriately

Wrong Users Notified#

Issue: Incorrect users receiving alerts

Solution:

  • Verify user IDs are correct numeric values
  • Check user IDs in PostHog user settings
  • Update subscribedUsers array with correct IDs

Getting User IDs#

To find PostHog user IDs:

  1. Go to PostHog Settings → Team
  2. View team members list
  3. Note the numeric user ID (visible in URLs or API responses)

Or use the PostHog API:

Getting Insight IDs#

To find insight IDs:

  1. Open the insight in PostHog
  2. Check the URL: /insights/12345 - the number is the ID
  3. Or use the PostHog API to list insights

Additional Resources#