Royal Glow internal docs · now fully interactive — Steps, API tables, file trees & live status
Royal Glow Docs

Observability

Five-layer observability stack for Royal Glow — Sentry, BetterStack, PostHog, Clarity, and Checkly.

Observability

In one line: Five layers, each answering a different question, all on free tiers at ₹0/month — Sentry (errors), BetterStack (uptime + status + jobs + logs), PostHog (product analytics), Microsoft Clarity (heatmaps + replay), and Checkly (synthetic monitoring).

Royal Glow uses five distinct observability layers, each answering a different question. Total monthly cost: ₹0.

LayerQuestion It AnswersTool
Error MonitoringWhat broke and why? Stack traces, error contextSentry
Uptime + Status + Logs + JobsIs the site up? Did scheduled jobs run?BetterStack
Product AnalyticsHow do users behave? Where do they drop off?PostHog
Heatmaps + Session ReplayWhat did the user actually do on screen?Microsoft Clarity
Synthetic MonitoringDoes the app actually work from a real browser?Checkly

The five layers

Layer 1 — Error Monitoring. Free tier: 5,000 errors/month — more than sufficient at launch.

Sentry captures errors from both Cloudflare Workers (edge) and Render (Node.js/Payload CMS). Source maps are uploaded during build so errors point to original TypeScript lines, not minified output.

What Sentry captures:

  • Unhandled API route exceptions
  • Client-side React errors (via Error Boundaries)
  • Edge Worker errors (Cloudflare)
  • Performance traces (slow DB queries, slow API responses)

Alert rules:

RuleConditionAction
CriticalAny new error level issueSlack #alerts-critical + Email
High frequency>10 same error in 5 minSlack #alerts-critical
External service down>3 upstream errors in 5 minSlack #alerts-infra

What is NOT sent to Sentry:

  • Business rule violations (4xx errors) — these are expected
  • Validation errors (400) — these are expected
  • Rate limit exceeded (429) — these are expected

Layer 2 — Uptime, Status Page, Logs & Job Monitoring. BetterStack replaces three separate tools (UptimeRobot + Cronitor + a log tool) in one platform.

Uptime Monitors (10 of 10 free slots)

MonitorEndpoint
Homepagetheroyalglow.in
GMB booking deep linktheroyalglow.in/?book=1&utm_source=gmb
In-store QR deep linktheroyalglow.in/?book=1&utm_source=walkin
Campaign lead pagetheroyalglow.in/book
API healththeroyalglow.in/api/health
Payload CMScms.theroyalglow.in
Neon DB probeVia API health endpoint
Ably connectivityVia test endpoint
Upstash Redis probeVia API probe
Cloudflare R2 probeVia test asset endpoint

Check interval: 3 minutes (free tier). Average detection time ~1.5 minutes.

Heartbeat Monitors for Scheduled Jobs

Scheduled work pings a BetterStack heartbeat URL on successful completion. If BetterStack doesn't receive the ping within the expected window, it fires an alert.

HeartbeatJobs Covered
BETTER_STACK_HEARTBEAT_NIGHTLY_SALESDaily sales, offer expiry, monthly GST, gems auto-expire
BETTER_STACK_HEARTBEAT_MEMBERSHIP_EXPIRYMembership auto-expire + expiry alerts
BETTER_STACK_HEARTBEAT_SESSION_CLEANUPSession cleanup
BETTER_STACK_HEARTBEAT_PPRD_SYNCProd → pprd branch reset + PII anonymization
BETTER_STACK_HEARTBEAT_REMINDERSAppointment reminders (every 15 min)

Status Page

Public status page at status.theroyalglow.in — customers can check during outages. Free, custom domain supported.

Layer 3 — Product Analytics. Free tier: 1 million events/month.

PostHog covers the full funnel: page views → service browsing → booking → conversion. It also provides feature flags for A/B testing offers without deploying new code.

Key Events

EventTrigger
page_viewEvery page
booking_startedCustomer opens the homepage booking dialog
booking_step_completedEach step of booking flow
booking_request_submittedCustomer submits booking; row created as pending
booking_confirmedReceptionist/manager approves the booking
booking_completedService completed and invoice generated
booking_abandonedLeft booking mid-flow
lead_form_submittedMeta/Instagram landing form submitted
lead_converted_to_bookingCaptured lead later links to a booking

Funnels to Build

  1. Organic → Homepage → Book Now → Dialog → Booking submitted → Confirmed
  2. GMB → /?book=1&utm_source=gmb → Dialog auto-opened → Booking submitted
  3. In-store QR → /?book=1&utm_source=walkin → Sign in → Booking submitted
  4. Meta ad → /book lead form → Homepage dialog → Lead converted to booking

Why Not Google Analytics

Google Analytics sends data to Google — a concern under India's DPDP Act 2023. PostHog is self-hostable and DPDP-compliant.

Layer 4 — Heatmaps & Session Replay. Free tier: Completely free, no event caps, no session limits.

Clarity complements PostHog — it's better at visual heatmaps, PostHog is better at funnel analytics.

What Clarity reveals:

  • Are users clicking the booking CTA or ignoring it?
  • How far do users scroll on the services page?
  • Where do users get confused on the booking form?
  • Which parts of the homepage get the most attention?
  • Rage clicks and dead clicks

Layer 5 — Synthetic Monitoring. Free tier: 5 checks, 10,000 check runs/month.

BetterStack answers "Is the server responding?" Checkly answers "Does the app actually work?" — it runs real Playwright scripts against production on a schedule.

RGSS Checkly Checks

CheckScheduleValidates
Homepage loads + services renderEvery 10 minCDN + SSR
Booking dialog: slots load for tomorrowEvery 15 minAPI + DB
Sign-in page rendersEvery 30 minAuth system
Admin dashboard loads (with auth)Every 30 minProtected routes
API health + response < 500msEvery 5 minSystem health

Complete Stack Summary

ToolLayerFree TierMonthly Cost
SentryError monitoring5k errors/mo₹0
BetterStackUptime + status + jobs + logs10 monitors, 1 GB logs₹0
PostHogProduct analytics + feature flags1M events/mo₹0
Microsoft ClarityHeatmaps + session recordingsUnlimited₹0
ChecklySynthetic monitoring5 checks, 10K runs/mo₹0
Total₹0/mo

Upgrade Path

WhenUpgrade
Errors exceed 5k/moSentry Team $26/mo
Need <30s uptime checksBetterStack Starter $24/mo
Need unlimited analyticsPostHog paid (scales by event volume)

All upgrades are triggered by growth — not required at launch.

All third-party browser scripts (PostHog, Clarity, Meta Pixel) load only after explicit cookie consent and only when their keys are configured. The cookie consent banner is a custom two-tier implementation — no paid consent management tool needed.

OpenReport an issue

Was this page helpful?

On this page