Firebase is one of the most popular Backend-as-a-Service platforms for web and mobile apps. But even with Google's infrastructure powering it, your Firebase-dependent apps can still experience outages—from Cloud Functions cold starts and quota errors to Realtime Database latency spikes and Hosting CDN issues.
In this guide, we'll walk through how to set up effective uptime monitoring for your Firebase backend using Vigilmon, a free multi-region monitoring tool.
Why Firebase Apps Need External Monitoring
You might think: "Firebase is managed by Google—why would I need to monitor it?" Here's why:
- Firebase Hosting CDN can have regional outages even when Firebase itself is fine
- Cloud Functions can return 500s due to deployment issues, code bugs, or cold-start timeouts
- Realtime Database security rules can block legitimate reads/writes
- Firebase Auth can have intermittent issues that break sign-in flows
- Quota limits can silently fail without alerting you
Google's own Firebase Status Page doesn't alert you when your specific app has problems—only when there are global Firebase incidents.
What to Monitor in a Firebase Stack
1. Firebase Hosting (Your Web App)
Your Firebase-hosted app has a public URL. Monitor it directly:
https://your-app.web.app
https://your-project.firebaseapp.com
Set up a Vigilmon HTTP check on your main app URL with:
- Method: GET
- Expected status: 200
-
Keyword check: Something in your
<title>or app content - Check interval: 1 minute
- Regions: US East, Europe West, Asia Pacific
2. Cloud Functions Health Endpoint
Add a dedicated health check to your Cloud Functions:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
// Health check endpoint for monitoring
exports.health = functions.https.onRequest(async (req, res) => {
try {
// Quick Firestore connectivity test
const db = admin.firestore();
await db.collection('_health').doc('check').set({
timestamp: admin.firestore.FieldValue.serverTimestamp(),
ok: true
});
res.status(200).json({
status: 'healthy',
timestamp: new Date().toISOString(),
region: process.env.FUNCTION_REGION || 'unknown'
});
} catch (error) {
res.status(500).json({
status: 'unhealthy',
error: error.message
});
}
});
Deploy it:
firebase deploy --only functions:health
Then add a Vigilmon check on https://your-region-your-project.cloudfunctions.net/health with expected status 200 and "status":"healthy" keyword check.
3. Realtime Database Connectivity
If you use Firebase Realtime Database, you can expose a public health node:
exports.dbHealth = functions.https.onRequest(async (req, res) => {
try {
const db = admin.database();
const ref = db.ref('_health');
await ref.set({ timestamp: Date.now(), ok: true });
const snapshot = await ref.once('value');
if (snapshot.val()?.ok) {
res.status(200).json({ status: 'healthy', rtdb: 'connected' });
} else {
res.status(500).json({ status: 'degraded', rtdb: 'read-failed' });
}
} catch (error) {
res.status(500).json({ status: 'unhealthy', error: error.message });
}
});
4. Critical API Endpoints
If your Firebase app exposes custom REST APIs (via Cloud Functions or Cloud Run), monitor each critical endpoint:
-
/api/products— returns your product catalog -
/api/auth/verify— validates tokens -
/api/webhooks/stripe— payment processing
Setting Up Vigilmon for Firebase
- Sign up at vigilmon.online — free, no credit card
- Create monitors for each Firebase component:
| Component | URL Pattern | Check Type |
|---|---|---|
| Hosting | https://myapp.web.app |
HTTP GET, expect 200 |
| Cloud Functions | https://us-central1-project.cloudfunctions.net/health |
HTTP GET, expect "healthy"
|
| Custom API | https://api.myapp.com/health |
HTTP GET, expect 200 |
-
Configure alerts via:
- Email (immediate)
- Slack webhook
- PagerDuty integration
- Discord webhook
Set up a status page to show users your Firebase app's current status
Monitoring Firebase Auth Flows
Firebase Authentication is critical for any app. To monitor it, create a test endpoint that validates the auth service is responding:
exports.authCheck = functions.https.onRequest(async (req, res) => {
try {
// List users is a lightweight admin check on Auth
await admin.auth().listUsers(1);
res.status(200).json({ status: 'healthy', auth: 'responding' });
} catch (error) {
res.status(500).json({ status: 'unhealthy', auth: error.message });
}
});
⚠️ Don't expose sensitive operations publicly. Use environment-based access controls or an API key check for health endpoints in production.
Alerting Thresholds for Firebase
Firebase has some characteristics that affect how you should set alert thresholds:
- Cold starts: Cloud Functions can take 2-10 seconds on a cold start. Set your timeout threshold to at least 15 seconds to avoid false positives.
- Quota resets: Firebase quotas reset daily. An alert at the end of the day could be a quota issue, not a real outage.
- CDN propagation: New deployments to Firebase Hosting take 1-5 minutes to propagate globally.
Recommended settings:
- HTTP timeout: 15 seconds
- Failure threshold before alert: 2 consecutive failures
- Check frequency: Every 1-2 minutes for production, 5 minutes for staging
What Vigilmon Checks That Firebase Doesn't Tell You
| Metric | Firebase Console | Vigilmon |
|---|---|---|
| Real user-facing uptime | ❌ (server metrics only) | ✅ |
| Multi-region reachability | ❌ | ✅ |
| Response time from user perspective | ❌ | ✅ |
| SSL certificate expiry alerts | ❌ | ✅ |
| Custom keyword validation | ❌ | ✅ |
| Incident history & SLA | ❌ | ✅ |
| Public status page | ❌ | ✅ |
Example: Full Firebase Monitoring Stack
Here's a complete monitoring setup for a typical Firebase app:
Monitors:
├── Web App (Firebase Hosting)
│ └── https://myapp.web.app → HTTP 200, keyword "My App"
├── Cloud Functions
│ └── https://us-central1-myproject.cloudfunctions.net/health → HTTP 200, keyword "healthy"
├── Custom API Gateway
│ └── https://api.myapp.com/health → HTTP 200
└── Realtime Database (via function proxy)
└── https://us-central1-myproject.cloudfunctions.net/dbHealth → HTTP 200
With this setup, you'll know within 60 seconds if any part of your Firebase infrastructure fails—before your users start tweeting about it.
Get Started Free
Vigilmon offers free uptime monitoring with:
- 5 monitors on the free tier
- 1-minute check intervals
- Multi-region monitoring (US, EU, Asia)
- Email alerts included
- Public status page
No credit card required. Set up Firebase monitoring in under 5 minutes.
Top comments (0)