Skip to content

Monitoring

PostHog Analytics

The site uses PostHog for product analytics, proxied through a custom domain to avoid ad blockers.

Setup

  • PostHog host: https://ph.anshulbisen.com (reverse proxy to avoid ad blockers)
  • Integration: posthog-js initialized in instrumentation-client.ts (Next.js instrumentation hook)
  • Persistence: localStorage+cookie
  • Debug mode: Enabled in development only (process.env.NODE_ENV === 'development')

Configuration

Environment variables (set at build time):

VariableValue
NEXT_PUBLIC_POSTHOG_KEYPostHog project API key
NEXT_PUBLIC_POSTHOG_HOSThttps://ph.anshulbisen.com

What's Tracked

  • Page views — automatic via capture_pageview: true
  • Page leave — automatic via capture_pageleave: true
  • Autocapture — clicks, inputs, form submissions (enabled)
  • Session replay — with masked inputs (maskAllInputs: true) and [data-mask] selector
  • Heatmaps — enabled via enable_heatmaps: true
  • Exception capture — automatic via capture_exceptions: true
  • Performance — automatic via capture_performance: true
  • Web Vitals — CLS, LCP, FCP, TTFB, INP reported as web_vital events (via web-vitals library)
  • App version — registered as app_version super-property

Cloudflare Analytics

Built-in analytics available in the Cloudflare dashboard:

  • Pages: Request count, bandwidth, unique visitors
  • Workers: Invocations, errors, CPU time, duration
  • KV: Read/write operations

Slack Notifications

CI/CD events are sent to the Homelab Slack workspace:

  • Workflow pass/fail (CI, Deploy, Deploy Chat Worker)
  • PR opened
  • PR merged

See CI/CD for workflow details.

Uptime Monitoring

Not Currently Configured

There is no dedicated uptime or health-check monitoring (e.g., Uptime Robot, Betterstack, Cloudflare Health Checks). The site relies on Cloudflare's built-in availability and the Slack CI/CD notifications to surface deployment failures. For a personal portfolio, this is sufficient — Cloudflare Pages and Workers have high inherent availability.