Build MetricsDocumentationWebhooks & Alerts

Webhooks & Alerts

Get notified about build regressions, failures, and performance issues in real-time

Overview

🔔 Stay Informed

Build Metrics can notify your team instantly when:

  • ✓ Build time increases significantly (regression detected)
  • ✓ Build size grows unexpectedly
  • ✓ Build fails or errors occur
  • ✓ Any custom threshold is exceeded

Slack Integration

Get notified in your team's Slack channel

Discord Integration

Send alerts to Discord webhooks

Custom Webhooks

Integrate with any tool via HTTP webhooks

Slack Integration

Step 1: Create Slack Webhook

  1. Go to your Slack workspace settings
  2. Navigate to Apps → Incoming Webhooks
  3. Click "Add to Slack"
  4. Choose the channel where you want notifications (e.g., #builds, #engineering)
  5. Click "Add Incoming WebHooks integration"
  6. Copy the webhook URL (looks like https://hooks.slack.com/services/...)

Step 2: Configure in Build Metrics

  1. Go to Build Metrics Dashboard
  2. Select your project
  3. Click "Settings" tab
  4. Scroll to "Webhooks & Alerts" section
  5. Click "Add Slack Webhook"
  6. Paste your Slack webhook URL
  7. Configure alert thresholds:
    • Build time regression: Alert when build time increases by X% or Y seconds
    • Build size growth: Alert when build size increases by X MB or Y%
    • Build failures: Always notify on failed builds
  8. Click "Save"

✅ Example Slack Message

⚠️ Build Regression Detected

Project: MyGame

Platform: Android

Build Time: 245s (+45s, +22%)

Build Size: 52 MB (+2 MB)

Commit: a1b2c3d - "Added new assets"

View details: https://app.buildmetrics.moonlightember.com/builds/123

Discord Integration

Step 1: Create Discord Webhook

  1. Open your Discord server
  2. Go to Server Settings → Integrations → Webhooks
  3. Click "New Webhook"
  4. Choose the channel for notifications (e.g., #builds)
  5. Customize name and avatar (optional)
  6. Click "Copy Webhook URL"

Step 2: Add to Build Metrics

  1. Go to Build Metrics Dashboard → Projects → Settings
  2. Scroll to "Webhooks & Alerts"
  3. Click "Add Discord Webhook"
  4. Paste your Discord webhook URL
  5. Configure alert rules (same as Slack)
  6. Click "Save"

Custom Webhooks

Integrate with any tool that accepts HTTP POST requests (PagerDuty, Datadog, custom dashboards, etc.)

Setup

  1. Go to Build Metrics Dashboard → Projects → Settings
  2. Click "Add Custom Webhook"
  3. Enter your webhook URL
  4. Configure authentication (optional):
    • Bearer token
    • Custom headers
    • Basic auth
  5. Configure alert rules
  6. Click "Save"

Webhook Payload

Build Metrics sends a JSON POST request to your webhook URL:

json
{
  "event": "build_regression",
  "project": {
    "id": "proj_abc123",
    "name": "MyGame"
  },
  "build": {
    "id": "build_xyz789",
    "platform": "Android",
    "buildTimeSeconds": 245,
    "previousBuildTimeSeconds": 200,
    "buildTimeDelta": 45,
    "buildTimePercentChange": 22.5,
    "outputSizeBytes": 54525952,
    "previousOutputSizeBytes": 52428800,
    "outputSizeDelta": 2097152,
    "unityVersion": "2022.3.10f1",
    "timestamp": "2026-01-31T12:00:00Z",
    "gitCommitSha": "a1b2c3d",
    "gitCommitMessage": "Added new assets",
    "gitBranch": "main"
  },
  "alert": {
    "type": "build_time_regression",
    "threshold": {
      "percentIncrease": 20,
      "secondsIncrease": 30
    },
    "message": "Build time increased by 45s (+22.5%)"
  },
  "url": "https://app.buildmetrics.moonlightember.com/builds/build_xyz789"
}

Event Types

EventWhen It Triggers
build_regressionBuild time or size exceeds threshold
build_failureBuild fails or errors occur
build_successBuild completes successfully (optional)

Alert Configuration

Alert Rules

Rule TypeExample Configuration
Build Time IncreaseAlert if time increases by >20% OR >30 seconds
Build Size IncreaseAlert if size increases by >10 MB OR >15%
Build FailuresAlways alert (enabled by default)
Per-Platform RulesDifferent thresholds for Android vs iOS vs WebGL

💡 Best Practices

  • Start with conservative thresholds (30% increase) and tighten as needed
  • Use OR conditions: alert if either percentage OR absolute value exceeded
  • Set different thresholds per platform (WebGL builds are typically slower)
  • Create separate channels for different alert severities

Troubleshooting

Webhooks Not Triggering

  • Verify webhook URL is correct and accessible
  • Check alert thresholds aren't too high
  • Ensure webhooks are enabled for the project
  • Test webhook with "Send Test" button in dashboard
  • Review webhook logs in Build Metrics dashboard

Too Many Alerts

  • Increase alert thresholds to reduce noise
  • Add cooldown period (e.g., max 1 alert per hour)
  • Filter alerts by branch (only alert on main)
  • Disable "build success" notifications if too frequent

Slack/Discord Not Receiving

  • Verify webhook URL hasn't expired or been revoked
  • Check channel permissions in Slack/Discord
  • Ensure webhook is configured for correct channel
  • Test with curl command to verify webhook works

Next Steps

📚 Need Help?

Have questions about webhooks or alert configuration?