Cron Execution History
Analyze performance and reliability of your crons over time
Execution history is the memory of your crons. Each execution is recorded with its timestamp, duration, and final status. This data forms a valuable timeline that allows analyzing performance, identifying trends, and anticipating problems before they impact production.
Without history, you navigate blindly. How do you know if a cron is taking longer and longer? How do you prove your SLAs are being met? How do you identify the correlation between a deployment and a series of failures? History answers all these questions with objective data.
MoniTao automatically collects the history of each heartbeat. Every received ping is timestamped and stored, creating a visual timeline of your executions. Aggregated metrics (success rate, average duration, trends) are calculated in real-time to facilitate analysis.
Key Metrics to Track
These indicators give you a complete view of your crons' health:
- Success rate: The success/total ratio over a period. A rate < 99% on a critical cron deserves investigation. The trend is as important as the absolute value.
- Average duration: Average execution time. Helps size resources and detect degradations. Compare day/week/month to see trends.
- Maximum duration: Outliers reveal load peaks or occasional problems. A cron with max duration 10x higher than average probably has an issue.
- Actual frequency: Number of executions per period. Verifies the cron runs at expected rate and detects misses.
Benefits of History
Execution history offers concrete advantages for operational management:
- Degradation detection: A cron that takes 10% longer each week will hit its timeout in a few months. History helps anticipate.
- Incident analysis: After an incident, history shows exactly when problems started and helps identify the cause (deployment, data change, etc.).
- Resource justification: Concrete data to justify a server upgrade, optimization, or maintaining status quo to management.
- SLA compliance: Prove your jobs run within agreed timeframes. Essential for audits and customer contracts.
MoniTao History Features
MoniTao provides comprehensive tools to leverage your cron history:
- Visual timeline: Visualize each execution on a chronological strip. Successes in green, failures in red, in progress in orange. Spot patterns at a glance.
- Real-time metrics: Success rate, average duration, and counters updated automatically. No manual calculation needed.
- Periodic comparison: Compare this week's performance vs previous, this month vs last. Identify trends.
- Export and integration: Export data to CSV or via API. Integrate with your existing tools (Grafana, Datadog, Excel).
Enriching Pings Example
Add contextual data to your pings for richer history:
#!/bin/bash
# Script with enriched data for history
START_TIME=$(date +%s)
# Your business logic
/usr/bin/php /var/www/app/process.php
EXIT_CODE=$?
RECORDS_PROCESSED=$(cat /tmp/last_run_count)
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
# Ping with enriched metrics
curl -fsS "https://api.monitao.com/ping/your-token" \
-d "{
\"status\": \"$([ $EXIT_CODE -eq 0 ] && echo success || echo failed)\",
\"duration\": $DURATION,
\"records\": $RECORDS_PROCESSED,
\"exit_code\": $EXIT_CODE
}" \
-H "Content-Type: application/json"
This script measures execution duration and counts processed records. These metrics enrich MoniTao history, allowing correlation between performance and data volume. You can add any metric relevant to your context.
Useful Analyses to Perform
History enables many analyses to improve your crons:
- Day/night analysis: Compare durations by execution time. A slower cron at night may indicate concurrent backups.
- Deployment correlation: Overlay deployment dates with performance variations. A post-deploy slowdown points to a regression.
- Seasonal patterns: Some crons take longer at month-end (reporting), year-start (archiving). Identify these patterns.
- Progressive degradation: Graph weekly average duration over 6 months. An ascending slope indicates a growing problem to address.
History Management Checklist
- Define retention period according to needs
- Identify key metrics for each cron
- Schedule monthly trend review
- Configure trend-based alerts
- Export regularly for long-term archiving
- Document analyses and decisions made
Frequently Asked Questions
How long does MoniTao retain execution history?
Retention depends on your plan: Free keeps 7 days, Pro 30 days, Business 90 days. For longer history, regularly export your data via API or CSV and archive in your own system.
How do I detect a cron that's progressively slowing over time?
Compare the average duration of the last 7 days with the previous month. An increase over 20% deserves investigation. MoniTao also displays a trend graph that visualizes this evolution.
Can I export history to my existing monitoring system?
Yes, via MoniTao's REST API or CSV export from the dashboard. Data is compatible with Grafana, Datadog, New Relic, and any system accepting JSON or CSV.
My cron failed yesterday at 3am. How do I diagnose?
MoniTao history shows the exact failure time and status. For technical details (stack trace, error message), check your application logs. Correlated with history, you have a complete view.
How do I use history to optimize my crons?
Identify crons with max duration >> average duration (indicating outliers). Analyze these peaks: do they coincide with other heavy processes? Increased data volume? These insights guide optimization.
History shows gaps. What do they mean?
A gap in history means the cron didn't execute (or didn't ping). This is exactly what heartbeat monitoring detects. Check the cause: server down, modified crontab, script crashed before ping.
History as a Strategic Tool
Execution history transforms raw data into actionable insights. It enables moving from reactive management (waiting for incidents) to proactive management (anticipating problems). Teams that leverage their history detect degradations before they impact users.
With MoniTao, history is collected automatically with each ping. Start by exploring the history of your existing crons, identify patterns and anomalies, then establish baselines. These references will allow you to immediately detect any significant deviation.
Useful Links
Ready to Sleep Soundly?
Start free, no credit card required.