Overview
Theanalysis command provides comprehensive uptime statistics and incident reports for a specific monitored URL. It shows current status, recent downtime, last check time, and incident counts over various time periods.
Usage
Aliases
an
Description
Theanalysis command generates a detailed report for a monitored URL, including:
- Current health status (healthy, unhealthy, or pending)
- How long the URL has been up or down
- Time since last health check
- Number of incidents in the last 24 hours, 7 days, 30 days, and 365 days
Arguments
The unique identifier of the URL to analyze. Find this ID using the
list command.Flags
This command has no flags.Examples
View analysis for a URL
Using the short alias
Analyze multiple URLs
Check several URLs in sequence:Output fields
The full URL being monitored
The HTTP method used for health checks (get, post, put, patch, delete)
How often the URL is checked (e.g., five_minutes, one_hour)
Current health status:
healthy- URL is reachableunhealthy- URL is unreachablepending- Not yet checked
How long the URL has been in its current state. Shows “Up for” when healthy, “Down for” when unhealthy.
Time elapsed since the last health check (e.g., “3m45s ago”)
Number of incidents over four time periods:
- Last 24 hours
- Last 7 days
- Last 30 days
- Last 365 days (1 year)
Understanding uptime duration
The “Currently Up for” or “Currently Down for” duration is calculated as:- If the URL is healthy: Time since the last transition from unhealthy to healthy
- If the URL is unhealthy: Time since the last transition from healthy to unhealthy
- If no status changes exist: Time since the URL was first added to monitoring
For newly added URLs with status “pending”, no uptime/downtime duration is shown until the first health check completes.
Understanding incidents
An incident is counted when a URL transitions from healthy to unhealthy. The incident counts help you:- Identify unreliable services
- Track improvements or degradations over time
- Plan maintenance windows
- Set realistic SLA expectations
Error handling
Missing ID argument
URL not found
Database connection failed
If PostgreSQL is not accessible:.env are correct.
Common use cases
Pre-removal analysis
Before removing a URL, review its history:Incident investigation
When you receive an alert, check detailed statistics:Reliability reporting
Generate uptime reports for stakeholders:Frequency optimization
Check if a URL needs more or less frequent monitoring:Technical details
- The command queries the database for historical incident data
- Duration calculations use the current system time
- Incident counts use the incident repository with day-based filters
- If no incidents exist for a period, the count is 0 (not an error)
- Last check time is calculated from the most recent status entry
Interpreting the results
Healthy service example
Troubled service example
New service example
guard command is running to begin monitoring.
See also
- list command - Find URL IDs to analyze
- guard command - Ensure monitoring is active
- add command - Add new URLs to monitor
- remove command - Remove URLs from monitoring