Overview
When something goes wrong, use the Logs and Metrics endpoints to diagnose the issue. This guide walks through common problems and how to debug them.Getting Started with Logs
First, retrieve recent logs:time: When it happenedlevel: DEBUG, INFO, WARNING, or ERRORmessage: Details with job ID prefix (first 8 chars)
Common Issues & Solutions
Job Not Triggering
Symptom: Job is running but condition never triggers Debugging steps:-
Check logs for analysis results:
Look for:
-
Review the explanation:
If the explanation doesn’t match your expectations, your condition may be:
- Too specific
- Poorly worded
- Not matching what’s actually in the stream
-
Test with Check-Once:
Compare the explanation to what you see in the stream.
-
Refine your condition:
High Frame Skip Rate
Symptom: Most frames are being skipped by pre-filter Check metrics:- 70%+ skip rate: Great! You’re watching a static scene (security cam). Pre-filter is saving money.
- 20%- skip rate: Stream has lots of motion. Consider if this is normal.
- Increasing over time: Could indicate the stream went offline or is now static.
- Lower sensitivity (if available in config):
MOTION_THRESHOLD=0.01 - Or accept it - high skip rates actually save you money!
Job Failing Immediately
Symptom: Job starts but immediately fails Check error logs:GOOGLE_API_KEY is set and valid
Stream Error:
interval_seconds, add fallback API key, or wait
Webhook Not Received
Symptom: Condition triggered but webhook didn’t arrive Check metrics:-
Check if your webhook is reachable:
Should return 2xx status code.
-
Check for timeouts:
Webhooks must respond within 5 seconds. If your receiver takes longer:
- Use background tasks
- Return immediately, process async
- Check firewall: Verify your server allows incoming connections from Trio’s IP range.
-
Check logs for delivery errors:
Stream Goes Offline
Symptom: Job fails with stream error Check logs:-
Verify stream is actually live:
- Open the URL in a browser
- Check if the stream is still broadcasting
-
Use URL validation before starting jobs:
-
Handle stream failures in your webhook:
High API Costs
Symptom: Bills are higher than expected Analyze metrics:- Increase
interval_seconds(60+ seconds) - Ensure pre-filter is enabled
- Use cheaper model (gemini-2.5-flash)
- Check for jobs left running 24/7 unintentionally
Debug Workflow
When a job isn’t working:-
Check if it’s running:
-
Review recent logs:
-
Check metrics for patterns:
-
Test condition independently:
- Refine and retry
Tips for Production
Monitor Continuously
Set up periodic health checks:Set Up Alerting
Alert on high error rates:Related Endpoints
- Get Logs - View server logs
- Get Metrics - View usage statistics
- Get Job Details - Check specific job status
- Check Once - Test conditions independently