0
0
Supabasecloud~10 mins

Monitoring and logging in Supabase - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Monitoring and logging
Start Supabase Project
Enable Monitoring Tools
Collect Metrics & Logs
Store Data in Dashboard
Analyze Metrics & Logs
Set Alerts if Issues Detected
Respond to Alerts & Fix Issues
Repeat Monitoring Cycle
This flow shows how Supabase monitoring collects data, stores it, analyzes it, and alerts you to keep your project healthy.
Execution Sample
Supabase
supabase logs --project-ref your-project-ref --since 1h
supabase metrics --project-ref your-project-ref
These commands fetch logs from the last hour and show performance metrics for your Supabase project.
Process Table
StepCommandActionOutput/Result
1supabase logs --project-ref your-project-ref --since 1hFetch logs from last 1 hourList of recent logs with timestamps and event details
2supabase metrics --project-ref your-project-refRetrieve performance metricsMetrics like CPU usage, DB connections, query times
3Analyze logs and metricsCheck for errors or slow queriesIdentify any warnings or errors in logs
4Set alert rules (via dashboard)Configure alerts for thresholdsAlerts trigger on high CPU or error spikes
5Receive alert notificationAlert sent to email or webhookNotification received for immediate action
6Fix issue based on alertApply fix or scale resourcesSystem performance improves
7Continue monitoringRepeat data collection and analysisOngoing health tracking
8ExitStop monitoring sessionMonitoring paused or stopped
💡 Monitoring session ends when user stops or pauses monitoring
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6Final
Logsemptylogs from last 1hlogs unchangedlogs filtered for errorslogs unchangedlogs unchangedlogs unchangedlogs unchanged
Metricsemptyemptymetrics retrievedmetrics unchangedmetrics unchangedmetrics unchangedmetrics unchangedmetrics unchanged
Alertsnonenonenonealert rules setalert triggeredalert resolvedalert clearednone
Key Moments - 3 Insights
Why do we fetch logs and metrics separately instead of together?
Logs and metrics are different data types; logs show events, metrics show performance numbers. Step 1 fetches logs, step 2 fetches metrics separately for clear analysis.
What happens if no alert rules are set?
Without alert rules (step 4), no notifications will be sent even if issues occur, so problems might go unnoticed as shown in step 5.
Why do we keep monitoring after fixing an issue?
Continuous monitoring (step 7) ensures the fix worked and detects new issues early, maintaining system health over time.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what output do we get after running 'supabase logs --project-ref your-project-ref --since 1h'?
AAlert notification sent to email
BList of recent logs with timestamps and event details
CMetrics like CPU usage and query times
DAlert rules configuration screen
💡 Hint
Check Step 1 output column in the execution_table
At which step do alert notifications get sent according to the execution table?
AStep 5
BStep 3
CStep 2
DStep 7
💡 Hint
Look for 'Alert sent to email or webhook' in the Action column
If alert rules are not set, what will be the state of Alerts after Step 5 in variable_tracker?
Aalert triggered
Balert cleared
Cnone
Dalert resolved
💡 Hint
Refer to Alerts row in variable_tracker after Step 5
Concept Snapshot
Monitoring and logging in Supabase:
- Use 'supabase logs' to fetch event logs
- Use 'supabase metrics' to get performance data
- Analyze logs and metrics for issues
- Set alert rules to get notified
- Respond to alerts and fix problems
- Keep monitoring continuously for health
Full Transcript
This visual execution shows how to monitor and log in Supabase. First, you fetch logs from the last hour using the logs command. Then, you get performance metrics separately. You analyze both to find errors or slow queries. Next, you set alert rules to notify you if something goes wrong. When alerts trigger, you receive notifications and fix the issues. Finally, you continue monitoring to keep your project healthy. Variables like logs, metrics, and alerts change step by step as you run commands and respond to alerts.